Message256743
There are a couple of places in the docs where it would be appropriate to replace __name__ by __spec__.__name__ in order to support the case where the module is executed as the __main__ module:
- logging.getLogger should certainly use __spec__.__name__ so that the logger hierarchy be respected (otherwise, when running "python -mpkg.subpkg", the logger of pkg.subpkg is named "__main__" and thus not a child of the "pkg" logger).
- examples for argparse.ArgumentParser (e.g. in the docs for venv) should use __spec__.__name__ instead of __name__ for the "prog=" argument.
(not guaranteed to be exhaustive) |
|
Date |
User |
Action |
Args |
2015-12-19 22:39:00 | Antony.Lee | set | recipients:
+ Antony.Lee, docs@python |
2015-12-19 22:39:00 | Antony.Lee | set | messageid: <1450564740.33.0.258115296695.issue25912@psf.upfronthosting.co.za> |
2015-12-19 22:39:00 | Antony.Lee | link | issue25912 messages |
2015-12-19 22:38:59 | Antony.Lee | create | |
|