[Python-Dev] Can Python implementations reject semantically invalid expressions? (original) (raw)
Steven D'Aprano steve at pearwood.info
Fri Jul 2 06:28:47 CEST 2010
- Previous message: [Python-Dev] Mercurial migration readiness
- Next message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This question was inspired by something asked on #python today. Consider it a hypothetical, not a serious proposal.
We know that many semantic errors in Python lead to runtime errors, e.g. 1 + "1". If an implementation rejected them at compile time, would it still be Python? E.g. if the keyhole optimizer raised SyntaxError (or some other exception) on seeing this:
def f(): return 1 + "1"
instead of compiling something which can't fail to raise an exception, would that still be a legal Python implementation?
-- Steven D'Aprano
- Previous message: [Python-Dev] Mercurial migration readiness
- Next message: [Python-Dev] Can Python implementations reject semantically invalid expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]