• Guido van Rossum's avatar
    Very subtle syntax change: in a list comprehension, the testlist in · 1c917072
    Guido van Rossum yazdı
    "for <var> in <testlist> may no longer be a single test followed by
    a comma.  This solves SF bug #431886.  Note that if the testlist
    contains more than one test, a trailing comma is still allowed, for
    maximum backward compatibility; but this example is not:
    
        [(x, y) for x in range(10), for y in range(10)]
                                  ^
    
    The fix involved creating a new nonterminal 'testlist_safe' whose
    definition doesn't allow the trailing comma if there's only one test:
    
        testlist_safe: test [(',' test)+ [',']]
    1c917072
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...