I am worried about Python 3

John Machin sjmachin at lexicon.net
Wed Apr 9 20:33:22 EDT 2008


On Apr 10, 8:12 am, "Terry Reedy" <tjre... at udel.edu> wrote:
> "jmDesktop" <needin4mat... at gmail.com> wrote in message
>
> news:77c208d1-8163-4acf-8e88-bd704e05bc04 at e39g2000hsf.googlegroups.com...
> | Two new versions of the language are currently in development: version
> | 2.6, which retains backwards compatibility with previous releases; and
> | version 3.0, which breaks backwards compatibility to the extent that
> | even that simplest of programs, the classic 'Hello, World', will no
> | longer work in its current form.
>
> That change is however, the one most immediately visible to new
> programmers. Most of the other statements are pretty much unchanged.  In
> any case, 'print' is an easy-to-use facade over sys.stdout.write(), with
> default formatting.  If really concerned about it, start programs with
>    import sys
>    write = sys.stdout.write
> and use that to write out explicitly formatted strings.  (Some people
> routinely do this for production code anyway.)
>
> tjr

Some C tragics do things like this, which appear to be 3.0-proof:
    def fprintf(f, fmt, *vargs):
        f.write(fmt % vargs)

Cheers,
John



More information about the Python-list mailing list