FAQ
I am still living in the 2.x world because all the things I want to do
right now in python are in 2 (django, pygame). But I want to be
excited about the future of the language. I understand the concept of
needing to break backwards compatibility. But it's not particularly
exciting to think about. What are the cool new bits I should be
reading up on?

Related reading ... http://lucumr.pocoo.org/2011/12/7/thoughts-on-python3

[Zaphod] Hey, Marvin! We've got a job for you.
[Marvin] I won't enjoy it.
[Zaphod] Yes, you will. There's a whole new life stretching out in front of you!
[Marvin] Oh, not another one!
[Zaphod] Shut up and listen! There'll be excitement and adventure and
really wild things!
[Marvin] Sounds awful.
[Zaphod] But, Marvin ...
[Marvin] I suppose you want me to help you to get into this spaceship ...
[Zaphod] Marvin, will you just listen!
[Marvin] ... and open the door for you.
[Zaphod] What? Er ... Yeah.
[Marvin] Well, I wish you'd just tell me, rather than try to engage my
enthusiasm, because I haven't got one.


--
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow

Search Discussions

  • Ian Kelly at Jan 4, 2012 at 6:20 pm

    On Wed, Jan 4, 2012 at 8:56 AM, Sean Wolfe wrote:
    I am still living in the 2.x world because all the things I want to do
    right now in python are in 2 (django, pygame). But I want to be
    excited about the future of the language. I understand the concept of
    needing to break backwards compatibility. But it's not particularly
    exciting to think about. What are the cool new bits I should be
    reading up on?
    pygame is available for Python 3. I've used it a small amount, and it
    appears to work just fine. There is also a fork of Django that
    supports Python 2 and Python 3 in a single codebase:

    https://bitbucket.org/vinay.sajip/django/

    It's still experimental right now, but that doesn't mean you couldn't
    try it out. The expectation is that it will be merged for the Django
    1.5 release.
  • Andrew Berg at Jan 4, 2012 at 10:13 pm

    On 1/4/2012 9:56 AM, Sean Wolfe wrote:
    I am still living in the 2.x world because all the things I want to do
    right now in python are in 2 (django, pygame). But I want to be
    excited about the future of the language. I understand the concept of
    needing to break backwards compatibility. But it's not particularly
    exciting to think about. What are the cool new bits I should be
    reading up on?
    All the cool new language features, of course. I've only started
    learning Python, so I haven't watched the "what's new" stuff for older
    versions (and therefore can't pull anything off the top of my head), but
    I am pretty excited for 3.3. The new exceptions, the LZMA module,
    support for cp65001 in Windows...

    http://docs.python.org/release/3.0.1/whatsnew/3.0.html
    http://docs.python.org/release/3.1.3/whatsnew/3.1.html
    http://docs.python.org/py3k/whatsnew/3.2.html
    http://docs.python.org/dev/whatsnew/3.3.html

    --
    CPython 3.2.2 | Windows NT 6.1.7601.17640
  • Rick Johnson at Jan 4, 2012 at 11:40 pm

    On Jan 4, 9:56?am, Sean Wolfe wrote:
    I am still living in the 2.x world because all the things I want to do
    right now in python are in 2 (django, pygame). But I want to be
    excited about the future of the language.
    Okay. So why not enjoy the best of both worlds (almost) and use
    version 2.7.2 along with "from __future__ import EVERYTHING".

    Your best course of action would be to write all code that can be
    written in Python 3000 IN Python 3000. If you must use Python 2.x
    because of dependencies, well then, you must.
  • Evan Driscoll at Jan 5, 2012 at 4:41 am

    On 1/4/2012 9:56 AM, Sean Wolfe wrote:
    I am still living in the 2.x world because all the things I want to do
    right now in python are in 2 (django, pygame). But I want to be
    excited about the future of the language. I understand the concept of
    needing to break backwards compatibility. But it's not particularly
    exciting to think about. What are the cool new bits I should be
    reading up on?
    This should be enough to convince you:

    ~ : python
    Python 2.7.1 (r271:86832, May 3 2011, 10:31:28)
    1 < "1"
    True

    ~ : python3
    Python 3.2 (r32:88445, May 3 2011, 13:26:55)
    1 < "1"
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: unorderable types: int() < str()

    Maybe with Python 4, '1 < True' will give a TypeError too ;-).


    Or if that's not enough,

    ~ : python
    Python 2.7.1 (r271:86832, May 3 2011, 10:31:28)
    True, False = False, True
    "True is " + ("True" if True else "False")
    'True is False'

    ~ : python3
    Python 3.2 (r32:88445, May 3 2011, 13:26:55)
    True, False = False, True
    File "<stdin>", line 1
    SyntaxError: assignment to keyword

    Evan
  • Lie Ryan at Jan 5, 2012 at 8:51 am

    On 01/05/2012 03:41 PM, Evan Driscoll wrote:
    On 1/4/2012 9:56 AM, Sean Wolfe wrote:
    I am still living in the 2.x world because all the things I want to do
    right now in python are in 2 (django, pygame). But I want to be
    excited about the future of the language. I understand the concept of
    needing to break backwards compatibility. But it's not particularly
    exciting to think about. What are the cool new bits I should be
    reading up on?
    This should be enough to convince you:

    ~ : python
    Python 2.7.1 (r271:86832, May 3 2011, 10:31:28)
    1< "1"
    True

    ~ : python3
    Python 3.2 (r32:88445, May 3 2011, 13:26:55)
    1< "1"
    Traceback (most recent call last):
    File "<stdin>", line 1, in<module>
    TypeError: unorderable types: int()< str()

    Maybe with Python 4, '1< True' will give a TypeError too ;-).


    Or if that's not enough,

    ~ : python
    Python 2.7.1 (r271:86832, May 3 2011, 10:31:28)
    True, False = False, True
    "True is " + ("True" if True else "False")
    'True is False'

    ~ : python3
    Python 3.2 (r32:88445, May 3 2011, 13:26:55)
    True, False = False, True
    File "<stdin>", line 1
    SyntaxError: assignment to keyword
    Somehow I could hear Sean saying something like: "Yeah... and so?"
  • K Richard Pixley at Jan 5, 2012 at 9:34 pm
    You get some of the good stuff by importing future, unicode literals
    which essentially means you're working in unicode by default most of the
    time, and print function, (a small fix but long overdue).

    I try to write python3 whenever I can. It's rare that dependencies keep
    me back. More often it's debugger problems or lack of distributions,
    (python3 doesn't entirely build on MacOsX Lion and the distributed
    binaries can't download third party code that requires compilation).

    If you do anything with raw data, the bytes/unicode upgrades are a god
    send. The old way was workable, (although I still don't understand
    string quoting). The new way is much better, more rational, easier to
    understand, more consistent, better documented, closer to intuitive
    expectations, and expressively clearer. Trying to find idioms that work
    for both is horrendous, though.

    Unicode rocks. This change alone is leading me to use python in many
    places where, in the past, I would have used /bin/sh for portability.
    Utf-8 file names, file names with spaces and other "special characters",
    and user entered data fields with diacriticals are all difficult to
    handle in /bin/sh, awkward in python2, but near trivial in python3.

    Classic classes are finally dead.

    Range now works like xrange used to. This is great, although a bit
    clumsy when trying to write for both 2 and 3 concurrently.

    In practice, most of the library changes are 1:1 renames, which are both
    worthwhile and easy enough to work with.

    Most of the other interesting features, (imo), have been backported to
    2.7. Context managers, "with", str.format(), etc.

    I'm currently writing in both more or less concurrently most of the
    time, (can't afford to live without the debugger), and I'm really,
    REALLY looking forward to the day when I can drop the python2 idioms. I
    really hate adding crap to python3 clean code in order to backport
    support for python2.

    Really, the biggest win to 3, aside from the unicode/bytes change, is
    the fact that a lot of outdated stuff is finally getting flushed. IMO,
    it's not so much about the new features, (context managers are big, but
    have been backported), as it is about the lack of pollution from ancient
    ones. Many of the new changes are ramifications of these removals.

    --rich
  • Peter at Jan 6, 2012 at 9:02 am
    I'm sure Python 3 is wonderful, but I make heavy use of the Python
    Imaging Library, which as I understand it has not been adapted to
    Python 3. There may be alternatives, but as I have a large amount of
    working code using PIL I am reluctant to drop it just yet.

    Peter

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 4, '12 at 3:56p
activeJan 6, '12 at 9:02a
posts8
users8
websitepython.org

People

Translate

site design / logo © 2022 Grokbase