On Fri, Jan 12, 2018 at 05:22:05PM +, Albert-Jan Roskam wrote:
>
> On Jan 11, 2018 03:47, Steven D'Aprano wrote:
[...]
> > Modules which are loaded from a .py or .pyc file on disk should always
> > have __file__ set. If they don't, that's a bug in the interpreter.
> >
>
On Fri, Jan 12, 2018 at 5:22 PM, Albert-Jan Roskam
wrote:
> On Jan 11, 2018 03:47, Steven D'Aprano wrote:
>>
>> Modules which are loaded from a .dll or .so binary file also should have
>> __file__ set.
>
> And .pyd? I would hope so
A .pyd is a
On Jan 11, 2018 03:47, Steven D'Aprano wrote:
>
> On Wed, Jan 10, 2018 at 08:02:24PM -0600, boB Stepp wrote:
>
> > I am still puzzling over things from the thread, "Why does
> > os.path.realpath('test_main.py') give different results for unittest
> > than for testing
On Wed, Jan 10, 2018 at 08:02:24PM -0600, boB Stepp wrote:
> I am still puzzling over things from the thread, "Why does
> os.path.realpath('test_main.py') give different results for unittest
> than for testing statement in interpreter?" The basic question I am
> trying to answer is how to
I am actually interested in the answer to this question for Python
versions 2.4, 2.6 and 3.x.
At https://docs.python.org/3/reference/import.html?highlight=__file__#__file__
it says:
__file__ is optional. If set, this attribute’s value must be a string.
The import system may opt to leave