[issue12273] Change ast.__version__ calculation to provide consistent ordering

Nick Coghlan report at bugs.python.org
Sat Jul 16 12:38:00 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

On Sat, Jul 16, 2011 at 8:24 PM, Martin v. Löwis <report at bugs.python.org> wrote:
>> sys.version_info and sys._mercurial provide all the info needed for someone (like me for mnfy)
>
> Can you please elaborate? How do you know from looking at
> sys._mercurial whether you can support that AST version?
> sys._mercurial changes with every commit, but the AST doesn't
> change that often.

For anyone not following CPython tip, the real version indicator is
sys.version_info (i.e. assuming the AST changes with each major Python
version and bumping your version check once you've determined that
your code is compatible with a later release).

Life is more difficult for anyone following CPython tip, but in that
case it is probably easier to just assume compatibility and
investigate further if a "hg pull" ever breaks anything. Since
"ast.__version__" wasn't usefully orderable post-Hg migration, the
previous best you could have done is checked for a specific version,
guaranteeing failure if we changed the AST in any respect. Agreed that
sys._mercurial changes too often to be useful in even that limited
way, though.

----------
title: Change ast.__version__ calculation	to provide consistent ordering -> Change ast.__version__ calculation to provide consistent ordering

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12273>
_______________________________________


More information about the Python-bugs-list mailing list