Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-13 Thread John Machin
On Jan 13, 5:36 pm, Steve Holden wrote: > Miles wrote: > > On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote: > >> Using py2.5.4 and entering the following lines in IDLE, I don't really > >> understand why I get the result shown in line 8. > > >> Note the difference between lines 7 and 10 is that

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-13 Thread imageguy
On Jan 13, 1:01 am, Miles wrote: > On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote: > > Using py2.5.4 and entering the following lines in IDLE, I don't really > > understand why I get the result shown in line 8. > > > Note the difference between lines 7 and 10 is that 'else' clause > > result en

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-13 Thread Paul Rubin
imageguy writes: > Using py2.5.4 and entering the following lines in IDLE, I don't really > understand why I get the result shown in line 8. > > Note the difference between lines 7 and 10 is that 'else' clause > result enclosed in brackets, however, in line 2, both the 'c,d' > variables are assig

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-13 Thread Scott David Daniels
imageguy wrote: 1) >>> n = None 2) >>> c,d = n if n is not None else 0,0 ... This is more easily expressed as: c, d = n or (0, 0) -- http://mail.python.org/mailman/listinfo/python-list

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread Tim Roberts
imageguy wrote: >Using py2.5.4 and entering the following lines in IDLE, I don't really >understand why I get the result shown in line 8. > >Note the difference between lines 7 and 10 is that 'else' clause >result enclosed in brackets, however, in line 2, both the 'c,d' >variables are assign corr

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread Steve Holden
Miles wrote: > On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote: >> Using py2.5.4 and entering the following lines in IDLE, I don't really >> understand why I get the result shown in line 8. >> >> Note the difference between lines 7 and 10 is that 'else' clause >> result enclosed in brackets, howe

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread Miles
On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote: > Using py2.5.4 and entering the following lines in IDLE, I don't really > understand why I get the result shown in line 8. > > Note the difference between lines 7 and 10 is that 'else' clause > result enclosed in brackets, however, in line 2, both

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread imageguy
> understand why I get the result shown in line 8. >7) >>> c,d = n if n is not None else 0,0 >8) >>> print c,d >9) (22, 11) 0 OOPS sorry that should be line 9. g. -- http://mail.python.org/mailman/listinfo/python-list

Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread imageguy
Using py2.5.4 and entering the following lines in IDLE, I don't really understand why I get the result shown in line 8. Note the difference between lines 7 and 10 is that 'else' clause result enclosed in brackets, however, in line 2, both the 'c,d' variables are assign correctly without the bracke