Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > help me get excited about python 3

Thread Tools

help me get excited about python 3

Sean Wolfe
Posts: n/a
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 ...

[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
Reply With Quote
Rick Johnson
Posts: n/a
On Jan 4, 9:56*am, Sean Wolfe <(E-Mail Removed)> 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.
Reply With Quote
K Richard Pixley
Posts: n/a
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.

Reply With Quote
Posts: n/a
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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i'm excited luckydig1t Case Modding 10 04-06-2010 05:06 AM
D3000 and D300s is coming... so excited... TK Digital Photography 1 07-27-2009 09:33 AM
Excited New Games Digital Photography 0 01-16-2006 04:42 AM
Excited Alan D-W Digital Photography 5 11-28-2003 02:02 PM
WHICH Printer? Not excited about the Epson 7500 Sbtypesetter Digital Photography 3 09-12-2003 07:06 AM