stackoverflow quote on Python

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Nov 13 06:42:18 CET 2012


On Tue, 13 Nov 2012 03:08:54 +0000, Mark Lawrence wrote:

> http://stackoverflow.com/questions/tagged/python
> 
> "Python has two major versions (2 and 3) in use which have significant
> differences."
> 
> I believe that this is incorrect.  The warts have been removed, but
> significant differences, not in my book.  If there is agreement about
> there not being significant differences, should stackoverflow be asked
> to change their wording?

Define "significant".

If StackOverflow mean "significant like the differences between Lisp and 
Cobol", then they are clearly wrong.

On the other hand, if you are suggesting that nothing short of the 
differences between Lisp and Cobol count as significant, then I think you 
too are wrong.

There are clear differences between the two versions, and the much-talked-
about "print is now a function" is the least among them:

* major reorganisation of parts of the standard library, with many
  libraries being removed, renamed, reorganised, or added;

* file objects are completely re-implemented;

* strings are now proper text strings (Unicode), not byte strings;

* nonlocal;

* keyword-only parameters for functions;

* cannot use grouped parameters in functions, e.g. def spam(a, (b,c), d)
  no longer is allowed;

* cannot use "import *" inside a function;

* dict methods keys(), values(), items() are iterators;

* so are map, reduce, zip;

* builtins like reduce, reload have been moved to modules;

* some itertools functions are now builtins;

* sorted and list.sort no longer support comparison functions;

* comparisons between different types may raise TypeError;

* extended iterable unpacking;

* function annotations;

* dict comprehensions and set literals;

* new metaclass syntax;

* classic classes are gone;

* automatic delegation doesn't work for __dunder__ methods;

* backticks `x` gone;


among others. Are these "significant" differences? Well, maybe.



-- 
Steven


More information about the Python-list mailing list