[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread anatoly techtonik

anatoly techtonik  added the comment:

I can't find where it is recommended to move code to Python 2.7 before porting.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread anatoly techtonik

anatoly techtonik  added the comment:

Then the docs should say that this is the 2.6 code, not 2.x

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread Eric Smith

Eric Smith  added the comment:

Plus, it's recommended to move to 2.6 or 2.7 before trying to port to 3.x.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread Éric Araujo

Éric Araujo  added the comment:

Your title is untrue: This example code from the 2.6 docs is valid 2.6 code.  I 
can’t find a problem with that.

--
nosy: +eric.araujo
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread anatoly techtonik

Changes by anatoly techtonik :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11644] 2to3 example.py is not a Python 2.x file

2011-03-22 Thread anatoly techtonik

New submission from anatoly techtonik :

http://docs.python.org/library/2to3.html#using-2to3 contains an example.py 
sample which is claimed to be Python 2.x source, but that's not true:

def greet(name):
print "Hello, {0}!".format(name)
print "What's your name?"
name = raw_input()
greet(name)

The code is valid only for Python 2.6+. For previous versions it gives the 
following traceback:

Traceback (most recent call last):
  File "ewe.py", line 5, in 
greet(name)
  File "ewe.py", line 2, in greet
print "Hello, {0}!".format(name)
AttributeError: 'str' object has no attribute 'format'

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 131817
nosy: techtonik
priority: normal
severity: normal
status: open
title: 2to3 example.py is not a Python 2.x file

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com