Generator expressions were added in 2.4, django uses them in a number
of places doesn't it?

On Jul 13, 11:50 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> On Mon, Jul 14, 2008 at 12:25 AM, Karen Tracey <[EMAIL PROTECTED]> wrote:
>
> [snip]
>
> >   File "D:\u\kmt\django\trunk\tests\regressiontests\admin_scripts\tests.py",
> > line 56
> >     cmd += ''.join(' %s' % arg for arg in args)
> >                                  ^
> > SyntaxError: invalid syntax
>
> > (the caret points to the 'r' in 'for' in fixed-pitch font)
>
> > Same django checkout works if I just use python 2.5.1 instead.  Is this new
> > syntax not supported by 2.3?
>
> It would appear so:
>
> Python 2.3.4 (#1, Nov 20 2007, 15:18:15)
> [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> [a 
> for a in ['1','2','3']]
> ['1', '2', '3']
> >>> ''.join(a for a in ['1','2','3'])
>
>   File "<stdin>", line 1
>     ''.join(a for a in ['1','2','3'])
>                 ^
> SyntaxError: invalid syntax>>> ''.join([a for a in ['1','2','3']])
>
> '123'
>
> However in 2.4:
>
> Python 2.4.3 (#3, Jun  8 2007, 04:52:26)
> [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> 
> ''.join(a for a in ['1','2','3'])
> '123'
> >>> ''.join([a for a in ['1','2','3']])
>
> '123'
>
> --
> ----
> Waylan Limberg
> [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to