[issue24632] Improve documentation about __main__.py

2021-08-24 Thread Łukasz Langa
Łukasz Langa added the comment: Solved as part of BPO-39452. -- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker

[issue24632] Improve documentation about __main__.py

2021-08-22 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch nosy: +jack__d nosy_count: 11.0 -> 12.0 pull_requests: +26357 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26883 ___ Python tracker

[issue24632] Improve documentation about __main__.py

2021-06-20 Thread Cameron Simpson
Change by Cameron Simpson : -- nosy: +cameron ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24632] Improve documentation about __main__.py

2021-06-19 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list

[issue24632] Improve documentation about __main__.py

2021-06-19 Thread Irit Katriel
Irit Katriel added the comment: See also Issue39452 and Issue17359. -- nosy: +iritkatriel ___ Python tracker ___ ___

[issue24632] Improve documentation about __main__.py

2018-08-28 Thread Mitch Gann
Mitch Gann added the comment: Can someone please update the Docs on this? Its been over 3 years since the issue was raised and seems fairly straightforward to address. Also considering its a fairly important feature of the language which deals with the entry point for packages/modules to

[issue24632] Improve documentation about __main__.py

2016-10-05 Thread Nick Coghlan
Nick Coghlan added the comment: In the same vein of "I never worked out a good offical home for it", a couple of the "Traps for the Unwary" I describe for Python's import system are closely related to __main__ module execution and the impact that has on sys.path and sys.modules: *

[issue24632] Improve documentation about __main__.py

2016-10-05 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I never found a good place to document this, hence the relatively sparse references in the "using" docs. The most complete official docs for these features are actually in runpy: * https://docs.python.org/3/library/runpy.html#runpy.run_module *

[issue24632] Improve documentation about __main__.py

2016-10-05 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue24632] Improve documentation about __main__.py

2016-10-05 Thread Dima Tisnek
Dima Tisnek added the comment: +1, I too would like to see this documented -- nosy: +Dima.Tisnek ___ Python tracker ___

[issue24632] Improve documentation about __main__.py

2016-01-03 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ncoghlan versions: +Python 3.6 -Python 3.4 ___ Python tracker ___

[issue24632] Improve documentation about __main__.py

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: -ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24632 ___ ___ Python-bugs-list

[issue24632] Improve documentation about __main__.py

2015-07-16 Thread Ezio Melotti
Ezio Melotti added the comment: I think this is due to PEP 420 Namespace Packages. It works on Python 2 too: $ ls execdir/ foo.py __main__.py $ cat execdir/foo.py print(foo imported) $ cat execdir/__main__.py import foo; print(main imported) $ python execdir/ foo imported main imported $

[issue24632] Improve documentation about __main__.py

2015-07-16 Thread Davide Rizzo
Davide Rizzo added the comment: As far as I understand, assuming dir/ contains a __main__.py file $ python dir is equivalent to $ python dir/__main__.py in that it's behaviourally nothing more than executing a script in that dir and setting sys.path accordingly. This is the same in Python 2

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread Ezio Melotti
Ezio Melotti added the comment: Another thing that should be clarified, is the difference between __main__.py inside a package, and __main__.py inside a zip file. For packages, as far as I understand, __main__.py should be inside the package (i.e. pkg/__main__.py, in the same dir of

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread Ethan Furman
Ethan Furman added the comment: RDM noted: - The surprising thing is that __main__ works without there being an __init__. I didn't know that, assumed it wasn't true, and so never tried it. I think this is due to PEP 420 Namespace Packages. --

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread R. David Murray
R. David Murray added the comment: The surprising thing is that __main__ works without there being an __init__. I didn't know that, assumed it wasn't true, and so never tried it. -- ___ Python tracker rep...@bugs.python.org

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread Ezio Melotti
Ezio Melotti added the comment: After further tests, I think I figured out how things works. There are three separate things that interact with each other: * packages (dirs with an __init__.py) and regular dirs (with no __init__.py) or zip files; * how python is executed (with or without

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread R. David Murray
R. David Murray added the comment: What you just described is exactly what I would have said was the case (a zip file acts exactly like it was a directory), so I'm glad that's the way it actually works :). -- nosy: +r.david.murray ___ Python

[issue24632] Improve documentation about __main__.py

2015-07-15 Thread Ezio Melotti
Ezio Melotti added the comment: The surprising thing is that __main__ works without there being an __init__. That's also what surprised me, I always thought __main__.py was supposed to be used within a package executed with python -m pkg, but apparently regular dirs and zip files can have

[issue24632] Improve documentation about __main__.py

2015-07-14 Thread Ezio Melotti
New submission from Ezio Melotti: __main__.py seems to only be mentioned briefly in a couple of places in the official docs: 1) https://docs.python.org/3/library/__main__.html 2) https://docs.python.org/3/using/cmdline.html#cmdoption-m The first link only says: For a package, the same effect

[issue24632] Improve documentation about __main__.py

2015-07-14 Thread Ned Batchelder
Ned Batchelder added the comment: BTW, the Stack Overflow answer: http://stackoverflow.com/a/4043007 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24632 ___