]> granicus.if.org Git - python/commit
Remove the horrid generators hack from doctest.py. This relies on a
authorTim Peters <tim.peters@gmail.com>
Sat, 18 Aug 2001 00:05:50 +0000 (00:05 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 18 Aug 2001 00:05:50 +0000 (00:05 +0000)
commit4fd9e2fc134a8a95fa9ef29e39572f82f3b5240e
tree2ca726b097c0ba840ded3db7805aec2cf606d698
parentec927348c2b38b9a4f79ff83f6d4d7f07f55458d
Remove the horrid generators hack from doctest.py.  This relies on a
somewhat less horrid hack <wink>:  if a module does
    from __future__ import X
then the module dict D is left in a state such that (viewing X as a
string)
    D[X] is getattr(__future__, X)
So by examining D for all the names of future features, and making that
test for each, we can make a darned good guess as to which future-features
were imported by the module.  The appropriate flags are then sucked out
of the __future__ module, and passed on to compile()'s new optional
arguments (PEP 264).

Also gave doctest a meaningful __all__, removed the history of changes
(CVS serves that purpose now), and removed the __version__ vrbl (similarly;
before CVS, it was a reasonable clue, but not anymore).
Lib/doctest.py