[Python-Dev] Can Python implementations reject semantically invalid expressions? (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jul 3 06:42:42 CEST 2010
- Previous message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Next message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Craig Citro wrote:
However, in this particular case, here's a question: why would someone write "return 1 + '1'"?
They might not intend to execute the code at all -- e.g. they may want to pass the compiled code to dis() to find out what bytecode gets generated. Having it refuse to compile would be annoying in that case.
-- Greg
- Previous message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Next message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]