[Python-Dev] PEP 414 (original) (raw)
Ned Batchelder ned at nedbatchelder.com
Sun Feb 26 13:34:59 CET 2012
- Previous message: [Python-Dev] PEP 414
- Next message: [Python-Dev] PEP 414
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2/26/2012 6:14 AM, Nick Coghlan wrote:
As soon as you allow the use of "from future import unicodeliterals" or a module level "metaclass = type", you can't review diffs in isolation any more - whether the diff is correct or not will depend on the presence or absence of module level tweak to the language semantics.
Future imports work well for things like absolute imports, new keywords, or statements becoming functions - if the future import is missing when you expected it to be present (or vice-versa) will result in a quick SyntaxError or ImportError that will point you directly to the offending code. Unicode literals and implicitly creating new-style classes are a different matter - for those, if the module level modification takes place (or doesn't take place when you expected it to be there), you get unexpected changes in behaviour instead of a clear exception that refers directly to the source of the problem. There are already future imports that violate this principle: from future import division. That doesn't mean I'm in favor of this new future, just keeping a wide angle on the viewfinder.
--Ned.
- Previous message: [Python-Dev] PEP 414
- Next message: [Python-Dev] PEP 414
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]