On 12/07/13 11:07, eryksun wrote:
On Thu, Jul 11, 2013 at 9:01 PM, Steven D'Aprano <st...@pearwood.info> wrote:
          try:
              if int(sys.version[0]) < 3:
                  input = raw_input
              numbers_str = original = input('Enter a positive'
'integer, space separated if desired.') # error occurs here

Oddly, the error only occurs in Python 3.3 - the above works in Python 2.7

The rules for local variables are rather more complicated in Python 2 and it
may be that you're somehow slipping through the cracks.

In 2.x the if statement executes, so the local variable "input" gets assigned.


/facepalm


Ah, I mean, I knew that!


--
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to