This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yanhao.charles
Recipients yanhao.charles
Date 2022-03-05.00:01:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As described in the doc:

> If the supplied path directly references a script file (whether as source or as precompiled byte code), then __file__ will be set to the supplied path, and __spec__, __cached__, __loader__ and __package__ will all be set to None.

$ cat
print(f'{__name__ = }')
print(f'{__package__ = }')

$ cat
import runpy

$ python3
__name__ = '<run_path>'
__package__ = ''

`__package__` is not set to None as in the doc.
Date User Action Args
2022-03-05 00:01:39yanhao.charlessetrecipients: + yanhao.charles
2022-03-05 00:01:39yanhao.charlessetmessageid: <>
2022-03-05 00:01:39yanhao.charleslinkissue46926 messages
2022-03-05 00:01:39yanhao.charlescreate