[Python-Dev] Making None a keyword

Fred L. Drake, Jr. fdrake@acm.org
2002年4月26日 01:16:38 -0400


Jeremy Hylton writes:
 > Does the parser prevent assignment to None? Or does the compiler need
 > to check for the use of None in an assignment?
Inside functions, you don't even need that. You just need to use
LOAD_CONST (or whatever its called now), since None is entry 0 in the
constants table, used by the implied "return None" when control drops
off the end. Doing this in function buys most of the performance.
 -Fred
-- 
Fred L. Drake, Jr. <fdrake at acm.org>
PythonLabs at Zope Corporation

AltStyle によって変換されたページ (->オリジナル) /