From: Mark Summerfield on
On 1 Dec, 23:52, John Bokma <j...(a)castleamber.com> wrote:
> Mark Summerfield <l...(a)qtrac.plus.com> writes:
> > It is available as a free PDF download (no registration or anything)
> > from InformIT's website. Here's the direct link:
> >http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/...
>
> Thanks!
>
> > And of course, if you want more on Python 3, there's always the
> > documentation---or my book:-)
> > "Programming in Python 3 (Second Edition)" ISBN-10: 0321680561.
>
> Meh, second edition already? Haven't read the entire first edition
> yet. Which is IMO a good book (I also gave it to my brother as a
> present).

If it is any consolation, the second edition should have a much longer
life, now that we have the language moratorium. (I _really_ wanted to
cover 3.1.)

> Only negative point (to me) so far is that in the beginning (p8-9) the
> book mentions placing Python programs in C:\py3eg which gives me the
> unpleasant feeling that someone is coding on Windows XP with
> Administrator rights...

OK, you got me there, I only use Windows for testing purposes and my
personal logon account does have Administrator rights, which I assumed
was standard for personal machines? Also, the path is short. It is
only a suggestion, it really doesn't matter where you unpack the
examples.

> Anyway, will add the 2nd edition to my wish list and donate the current
> one to the library in Xalapa (USBI)  if they want it :-)
>
> John

From: Mark Dickinson on
On Dec 2, 8:01 am, Mark Summerfield <l...(a)qtrac.plus.com> wrote:
> On 1 Dec, 17:50, Mark Dickinson <dicki...(a)gmail.com> wrote:
> > My only quibble is with the statement on the first page that
> > the 'String % operator is deprecated'.  I'm not sure that's
> > true, for all values of 'deprecated'.  There don't appear
> > to be any definite plans for getting rid of it just yet.
>
> I didn't make this up:-)

No, I didn't imagine for a second that you had!

> According to http://docs.python.org/dev/3.0/whatsnew/3.0.html
> "The plan is to eventually make this the only API for string
> formatting, and to start deprecating the % operator in Python 3.1."

I think that's a doc bug. "The plan is to ..." should read: "The plan
was
originally to ...". (Well, at least in the 3.1 version of the
"what's new in 3.0" documentation; the 3.0 version that you linked to
isn't even autogenerated any more, AFAIK, so fixes to the ReST source
for that file never make it to the web site.)

I'm a little confused myself about what's actually happening with
% formatting, but here's a fairly recent python-dev posting from
the BDFL:

http://mail.python.org/pipermail/python-dev/2009-September/092399.html

Mark
From: Wolodja Wentland on
On Wed, Dec 02, 2009 at 00:10 -0800, Mark Summerfield wrote:
> On 1 Dec, 18:30, Lie Ryan <lie.1...(a)gmail.com> wrote:

> > Also, I'm not sure what this change is referring to:
> > Python 2                 Python 3
> > L = list(seq)            L = sorted(seq)
> > L.sort()
> >
> > L.sort is still available in python, and sorted() have been available
> > since python 2. Both list.sort() and sorted() are for different purpose,
> > and neither will be deprecated. What's the change here?
>
> The document is about idioms as well as changes. In this case both
> approaches work in both versions, but it seems that there are still a
> lot of people who don't know about sorted(), so I put it in to show it
> as an idiom.

It would be quite nice if you could mark all the Python 3 idioms that
work in Python 2.X as well. This would allow readers that are still using
Python 2.X and are used to the 'old way' to adapt their coding style
accordingly. You could just add a little (2.X) after the idiom for
example.

And thanks for the nice cheat sheet! :-D

--
.''`. Wolodja Wentland <wentland(a)cl.uni-heidelberg.de>
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
From: Martin P. Hellwig on
Mark Summerfield wrote:
<cut>
> It is available as a free PDF download (no registration or anything)
> from InformIT's website. Here's the direct link:
> http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/python/python2python3.pdf
<cut>
Very handy! Am I wrong in assuming that you forgot to include that
file() is gone in favour of open()?

--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'
From: Mark Summerfield on
On Dec 1, 2:03 pm, Mark Summerfield <l...(a)qtrac.plus.com> wrote:
> I've produced a 4 page document that provides a very concise summary
> of Python 2<->3 differences plus the most commonly used new Python 3
> features. It is aimed at existing Python 2 programmers who want to
> start writing Python 3 programs and want to use Python 3 idioms rather
> than those from Python 2 where the idioms differ.
>
> It uses Python 3.1 syntax since that looks like being the standard for
> a few years in view of the language moratorium.
>
> The document is U.S. Letter size but will also print fine on A4
> printers.
>
> It is available as a free PDF download (no registration or anything)
> from InformIT's website. Here's the direct link:http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/...
>
> And of course, if you want more on Python 3, there's always the
> documentation---or my book:-)
> "Programming in Python 3 (Second Edition)" ISBN-10: 0321680561.


I only just found out that I was supposed to give a different URL:
http://www.informit.com/promotions/promotion.aspx?promo=137519
This leads to a web page where you can download the document (just by
clicking the "Download Now" button), but if you _choose_ you can also
enter your name and email to win some sort of prize.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: can you say it please
Next: can python do this?