[issue41297] Remove doctest import from heapq

2020-07-19 Thread Ronald Oussoren
Change by Ronald Oussoren : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41297] Remove doctest import from heapq

2020-07-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can we close this? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41297] Remove doctest import from heapq

2020-07-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: modulegraph already knows where the import is done, and users of the library can use that information to make decisions. There's no need to make changes to either heapq.py or modulegraph. For py2app I've made the choice to no be smart about inclusions and

[issue41297] Remove doctest import from heapq

2020-07-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: If not, could modulegraph add a flag to drop imports commonly found in main sections: doctest, unittest, argparse, etc.? Asking the standard library to change seems like the tail wagging the dog — it only paints over the problem since third-party

[issue41297] Remove doctest import from heapq

2020-07-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ronald, can modulegraph be made smarter with respect to sections of code guarded by __name__ == '__main__'?That Python idiom is old and pervasive. -- ___ Python tracker

[issue41297] Remove doctest import from heapq

2020-07-17 Thread Ronald Oussoren
Ronald Oussoren added the comment: I have no opinion on the proposed change. The "disruption" alex c talks about is that this imports gets seen by modulegraph (and hence pyinstaller and py2app), which will then include doctest and all its dependencies in standalone bundles even though

[issue41297] Remove doctest import from heapq

2020-07-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Steven. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue41297] Remove doctest import from heapq

2020-07-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: The idiom of a module running doctests on itself when executed as a script is a common idiom. If modulegraph and pyinstaller can't cope a module importing another module from inside an if statement, that's a bug in them, not in the heapq module (and many

[issue41297] Remove doctest import from heapq

2020-07-14 Thread alex c
New submission from alex c : heapq.py imports doctest in the last 4 lines to perform unit tests: if __name__ == "__main__": import doctest # pragma: no cover print(doctest.testmod()) # pragma: no cover This disrupts dependency tracking modules and software, like