Live data from Hacker News

Why I'm Making Python 2.8

naftaliharris.com

331–340 of 392 posts

Re: Why I'm Making Python 2.8

#331

Earlier quoted context omitted.

This approach could not have worked for modernizing python. The whole point of the Python 3 thing was to be able to remove warts in the language that could not have been fixed without breaking backwards compatibility. One core part of this is unicode support -- Python had a horrible story for international text before this. The fact that there are some parts of "modern" Python which could have been implemented in Pyt…

Python had a horrible story for international text before this. No, Python had a horrible story for text , and people who worked in limited/sheltered domains didn't realize it. I personally lost all kinds of valuable hours of my life fighting with Python 2's "pretend everything is ASCII until it isn't, then fall over dead" model, because I -- a US citizen, working at US companies, and for quite a while dealing only w…

Yeah, I agree, my bad on the phrasing.

Re: Why I'm Making Python 2.8

#332
post #271

Earlier quoted context omitted.

Isn't it as simple as a) do proper string handling in py2 unicode and b) if you write more u"" in a file than "", flip the switch and write "" and b"" instead?

Not quite, because the py2 library is often not compatible with unicode literals, and also because if you flip the switch in a module it changes the API of any functions that returned strings. That might break calling code from other modules. So then you might have to add code to work around these issues, code that is needed in neither pure py2 or pure py3 -- hence making it a weird detour. In general, it is more com…

Right.. our codebase is already unicode all over the place because otherwise we could not i18n properly. So we basically have py2 unicode-correct code with encode/decode in the proper places for interfacing witg stdlib. I didn't consider people might use str and not unicode for text..

Re: Why I'm Making Python 2.8

#333
post #316

Earlier quoted context omitted.

It can be silly, but that was one of the reason I picked Ruby over Python 5 years ago for a project. I felt at the time, Python is awesome, however they are taking a weird path.

Do you still feel that way or anything changed?

As a different person who made the same choice for the same reason at the same time I think I was very right then to avoid the whole mess.

It seems fine now, but there is nothing, as far as server side application coding is concerned, that would make me want to switch from Ruby/Rails.

Re: Why I'm Making Python 2.8

#334
post #321
post #292

Earlier quoted context omitted.

I don't want the CPython core devs to do anything different and are not angry with them at all. It is their pet and they can do what they want. I fully agree with what you say in that sense. But I do mind people saying in these discussions "you should all move to Py3 now or you are stupid/evil". No. There are legitimate reasons for staying with Py2.7 and embracing it. So I hope "Python 2.8" gets a cool name, perhaps…

> So I hope "Python 2.8" gets a cool name, perhaps even some funding from a company who wants to keep their Py2.7 code alive and invigorated, and the community part as friends. It has already been explained elsewhere in this discussion by other people, I would strongly advise against that. If you for whatever reason have to stay on 2.7, then make sure your new code is 2.7 only (and best if it works with 3 without cha…

What I was hoping for was a sane migration path to prevent the split you talk about in 2020...somebody made a superset of both py2 and py3 that lets one move gradually. If support ends/project dies one would bite the bullet and move all the way to py3 I guess.

My py2 code uses unicode properly which may color my view a bit...

But I don't really disagree with what you say.

Re: Why I'm Making Python 2.8

#335
post #304

Earlier quoted context omitted.

Go and Julia are already reaping the benefits. I see no future for Python be that 2 or 3. It's not great at anything, but projects a veneer of friendliness (that one should quickly outgrow) on top of a pile of bad implementation decisions and terrible design. Its popularity is based on superficial attributes rather than solid foundations. Eventually, the entire ecosystem will collapse and the masses will flood to the…

Julia can be a good competitor to Python, but far in the future. Now it's just not there yet. Go is interesting, but really a different (and perhaps smaller) use case. What, for instance, I do in Python? That little one-off script that converts one thing to another or calculates something - I am not sure why I would even bother thinking about Go. I have no doubt that at some point, Python will be replaced by somethin…

>C is also not based on solid foundations

C is based on the solidest possible foundation: the actual hardware CPU.

Re: Why I'm Making Python 2.8

#336

Slightly tangential, but: I've noticed an interesting parallel between the 2.7 / 3.x partisan divide, and the US political partisan divide. In both cases, as partisan passions have increased without relief, there's both A) an increasing unwillingness to agree on basic facts about reality essential to the debate, and B) increasing presumptions of bad faith on the part of their opponents. Examples of A in this discussi…

+1

I like how your comment stands out as being such a rational, non-aggressive observation in all this. I wish I had the answer for you, but I can't figure it out either. shrug Maybe some people are using this as an opportunity to vent the frustrations they've had with using the language (despite it being so loved, and ranked 3rd in most-used according to IEEE), and since there are two versions of the language instead of one, they can more readily create an object doomed for the epitome of their hatred, the sacrificial lamb going to the slaughter (sounds like something from a bizarre school of thought in psychology). You'd think it'd just be easier to let people do what works best for them. I'm sure many expect to take collateral damage from the differences in versions (imagine being a Python 3 fan and having to start working for a company that exclusively uses Python 2 or vice versa), but these people also readily accept working with languages with radically different designs and welcome in copy-cats (like Clojure is to other LISP-like languages). The important thing is that the language does what you need it to do. The name on the download link shouldn't make that much of a difference. The world has adapted to accepting Python 2 and Python 3 regardless of the bickering. There's room for "Python 2.8", even if it is poorly-named. I imagine there are probably dozens of Python 2.8s in existence - they just haven't been noticed by people here on HN. Besides, in about 3 months, we probably won't be hearing more about Python 2.8 anyways unless someone else decides to use it.

Re: Why I'm Making Python 2.8

#338
Why did Python 3 not ship with

    from __past__ import bytestring_literals, loose_comparison, integer_division, ...
? Being able to upgrade one file at a time to Py3 would have made porting so much easier! I realize some things could be hard to support file-at-a-time, but others (like my examples) would obviously not.

I've held off on porting the Py2 code that I'm responsible for because of the lack of total test coverage. I know that something tricky with unicode, None comparison, or the list->generator split will cause a failure in a weird, untested edge case. If I were making a numeric library, that'd be one thing. However, I mostly write complicated business logic API glue code that is hard to test without huge amounts of mocks.

Also, this kind of thing gives me nightmares about porting:

    WSGI therefore defines two kinds of "string":

    "Native" strings (which are always implemented using the type named str ) that are used for request/response headers and metadata
    "Bytestrings" (which are implemented using the bytes type in Python 3, and str elsewhere), that are used for the bodies of requests and responses (e.g. POST/PUT input data and HTML page outputs).
So according to the spec (!) WSGI headers MUST be `str` in Python 2 & 3, but that means that the semantic meaning of the types changes. How on earth am I supposed to write good code for working with headers (let alone mocking and testing) when I'm required to decode them in Python 2 but not in Python 3?

Re: Why I'm Making Python 2.8

#339

Author here. Imagine my surprise when I got back from a day of sightseeing (I'm on vacation in Spain) and saw that this had blown up. I had intended to "release" this project after New Years, after I'd gotten back and a week or two after 3.6 is released [1], and didn't expect this to get picked up since the project has been on Github for over a year (although inactive for much of that time) and since my blog usually…

Regardless of the detractors, I think this is brilliant work. All of the negativity around your project is over politics or subjective opinions based off of individual experience where they are lucky enough to work in environments on the bleeding edge.

Keep up the good work, this could help a lot of people!

Post reply on HN