[Python-ideas] New scope for exception handlers
Nick Coghlan
ncoghlan at gmail.com
Sat Apr 9 04:14:50 EDT 2016
More information about the Python-ideas mailing list
Sat Apr 9 04:14:50 EDT 2016
- Previous message (by thread): [Python-ideas] New scope for exception handlers
- Next message (by thread): [Python-ideas] A tuple of various Python suggestions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 9 April 2016 at 17:44, Steven D'Aprano <steve at pearwood.info> wrote: > So if you still want to champion your proposal, it's not enough to > demonstrate that it could be done. You're going to have to demonstrate > not only a benefit from the change, but that the benefit is worth > breaking other people's code. Not just any code, but "try it and see if it works" name binding idioms recommended in the reference documentation: https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection It's also worth noting that when it comes to detecting this kind of structural error, tools like pylint already do a good job of tracing possible control flow problems: $ cat > conditional_name_binding.py try: pass except: a = 1 print(a) $ pylint -E --enable=invalid-name conditional_name_binding.py No config file found, using default configuration ************* Module conditional_name_binding C: 4, 4: Invalid constant name "a" (invalid-name) More easily finding this kind of problem is one of the major advantages of using static analysis tools in addition to dynamic testing. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message (by thread): [Python-ideas] New scope for exception handlers
- Next message (by thread): [Python-ideas] A tuple of various Python suggestions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list