"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thus, for any backwards-incompatible change, two things are required: > > * An official Python Enhancement Proposal (PEP) > * Code that can identify pieces of Python 2.X code that may be > problematic in Python 3000
I should hope and like it specified that the code is required for final acceptance rather than submission. For some PEPs, triggering a warning will only require matching parsed names to the affected name(s). Example, moving filter from builtins to functools. I should hope that python3warn.py will at least parse the target code into tokens and have a dict of trigger_names:message_templates (or possible just a set if one template will do) and code something like if name in changed_names: warn(name, lineno, changed_names[name]) executed for each parsed name. Then the incremental code change needed is a line in the definition of changed_names. For some simple changes, we can do auto-edits (with programmer okays) instead of just warn. For the movement of filter, the change is either add 'from functools import filter' at the top or add 'import functools' if not there alread and change 'filter' to 'functools.filter'. So a python3edit could be added as a desireable possibility. (I initially thought filter replacement could be unconditional until I remembered the possibility of 'def filter...'. On the other hand, I have the impression that one of pylint/pychecker can detect builtin overrides already.) Terry Jan Reedy _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com