Author kxrob
Recipients kebab-mai-haddi, kxrob
Date 2021-02-22.18:14:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
#  `__main__` of the source code directory: `/tmp/rebound/rebound`. 
#  differentiate `__main__` of my target source code to read from the built-in `__main__`? In other words, how do I read the module `__main__` of the codebase: rebound?

=> when is inside a package, use the full dotted module name - and an appropriate search path below that directory:


When is intended as a top level module / script, I think such a name collision with an internal module name is a bad idea at all.
(For a special local purposes you could use a symlink or so?)

(I experience a bug with pyclbr (in py3.10 at least) when it traverses an "import __main__" statement. It causes also "ValueError: __main__.__spec__ is None" or "ValueError: {}.__spec__ is not set".  But this seems to be an actual bug w/o bug report so far: #43299 )
Date User Action Args
2021-02-22 18:14:03kxrobsetrecipients: + kxrob, kebab-mai-haddi
2021-02-22 18:14:03kxrobsetmessageid: <>
2021-02-22 18:14:03kxroblinkissue43247 messages
2021-02-22 18:14:03kxrobcreate