Earlier quoted context omitted.
You know what's funny? All of those things could have been done in Python 2.8, apart from the int division change. And the division change does as much harm as good, because lots of people use Python and also use another language where int division works the "old fashioned way"; for them (me) this change is counter-productive because it adds a pointless distinction. It is a great change for programming novices, for s…
The division change is good. I have a hard time understanding why you'd want 3/2 = 1 as the default behaviour.
Python 2 vs. Python 3: A retrospective
61–70 of 113 posts
Re: Python 2 vs. Python 3: A retrospective
#62Earlier quoted context omitted.
You know what's funny? All of those things could have been done in Python 2.8, apart from the int division change. And the division change does as much harm as good, because lots of people use Python and also use another language where int division works the "old fashioned way"; for them (me) this change is counter-productive because it adds a pointless distinction. It is a great change for programming novices, for s…
The division change is good. I have a hard time understanding why you'd want 3/2 = 1 as the default behaviour.
x = int(input(">>> "))
a = x / 2
append_int_to_magical_db(a)
If the division does a "naturaL" thing, you suddenly have a float "polluting" your integer algorithm, but it's _not consistent_. If the user enters "4", you get an int back. If they enter 5, you get a float.Re: Python 2 vs. Python 3: A retrospective
#63Re: Python 2 vs. Python 3: A retrospective
#64I'd really like to see the video for these slides. But here's what caught my interest: Set and dict comprehensions {x**2 for x in range(10)} {x: x**2 for x in range(10)} Why reduce() must die: ... the applicability of reduce() is pretty much limited to associative operators, and in all other cases it's better to write out the accumulation loop explicitly. int [divided by] int should return float nonlocal Explicit non…
You know what's funny? All of those things could have been done in Python 2.8, apart from the int division change. And the division change does as much harm as good, because lots of people use Python and also use another language where int division works the "old fashioned way"; for them (me) this change is counter-productive because it adds a pointless distinction. It is a great change for programming novices, for s…
Douglas Crockford made a point in a recent interview[1] (not the first time, I'm sure) that this is exactly the wrong reason to keep doing things "the way it's always been". Other examples he mentions: line endings (CR/LF), integer overflow, short vs long. Big vs little endian would be another obvious example.
Fred Brooks (Mythical Man Month) calls this "accidental complexity".
> [novices are] only part of Python's audience, and probably won't be the longest-lived part
By definition. But, it's not really a good use of anyone's time to be dealing with truncation in a time when it no longer has any reason to be the default except historical accident.
[1] http://hanselminutes.com/396/bugs-considered-harmful-with-do...
Re: Python 2 vs. Python 3: A retrospective
#65I would have been more interested in learning Python if there wasn't such a great divide. I read the first chapter of several books that said "Python 3 is out, but we're going to stick with 2.7 because too much shit is broken".
As someone who learned Python when 3.2 came out, I completely agree with you. I have only really used Python 2.7! Because too much shit is broken (NumPy, hello). Because Python 3 has been the default on basically no system ever (OK, maybe this is changing right now, slowly). As Guido says, it's been five years and it will take another five. This whole experiment has been a huge misstep for Python, an absolutely massi…
Re: Python 2 vs. Python 3: A retrospective
#66Earlier quoted context omitted.
The division change is good. I have a hard time understanding why you'd want 3/2 = 1 as the default behaviour.
Imagine the following (admittedly bad, minimalistic to make my point) code x = int(input(">>> ")) a = x / 2 append_int_to_magical_db(a) If the division does a "naturaL" thing, you suddenly have a float "polluting" your integer algorithm, but it's _not consistent_. If the user enters "4", you get an int back. If they enter 5, you get a float.
No, it always returns a float in Python 3. 4/2 gives 2.0.
Re: Python 2 vs. Python 3: A retrospective
#67Earlier quoted context omitted.
The Python ecosystem is far too diversified to get knocked down by one language. Python has a wealth of production-quality libraries across a ton of domains (Web, scientific computing, data science, NLP, parsing, scripting/automating, etc). Go is a non-entity in most of these domains and isn't even a top-20 programming language on Github (source: http://sogrady-media.redmonk.com/sogrady/files/2013/07/progr... ) Pytho…
The scientific Python community will never leave 2.5 -> 2.7, though...
Re: Python 2 vs. Python 3: A retrospective
#68Earlier quoted context omitted.
__ is basically a namespace for official language extensions. How would you suggest they do it? Prevent "next()" from being a valid method name?
That has been addressed in some many other ways by several languages that goes from the C++ way where you actually have namespaces to the C way where you don't worry about it and pick another name. From all of them I find this the most odd way to address it, specially when python was supposed to improve legibility by design (at least for me those underscores are very distracting)
Re: Python 2 vs. Python 3: A retrospective
#69Re: Python 2 vs. Python 3: A retrospective
#70It seems like I've been reading about the difficulties of Python V2 -> V3 for awhile. Why is that? Is this Python upgrade unusually difficult/ambitious? Or is the Python community just very reluctant to jump on new things?
Yes.
> Or is the Python community just very reluctant to jump on new things?
In my experience no. Lots of features have been added over the years, and they seem to be adopted quickly. v3 is a really big change though.