Package name with '.' in them: Python Bug ?
Stephen Robert Norris
srn at fn.com.au
Fri Mar 19 15:11:28 EST 2004
On Fri, 19 Mar 2004 19:12:03 +0100, Yannick Patois wrote:
> Hi,
>
>
> Terry Reedy wrote:
>> "Yannick Patois" <patois at calvix.org> wrote in message
>>>Under some naming conditions of module files, it seems that python lost
>>>class static variables values.
>> Since 'static variable' is not a Python concept, I do not know what you
>> mean.
>
> As you're so smart and you read the following, how do you call 'a' in
> class A ?
> That's what I want to qualify.
>
There's no need to be hostile. I'd call it a class variable. It's
certainly not static in any sense of the word I'd use.
>>>The value 1 obtained as expected (A.a is a static value and keept as
>> such).
>> Given that you rebound A.a to 1 from None, I especially do not know
>> what you mean.
>
> I dont understand.
You explicitly construct the A instance with 1, so what do you expect to
happen? A.a is set to None as a class variable, then changed to 1 by the
constructor.
>
>>>If now I just *rename* file B to B.1, without any change in the code
>>>(except name='B' become name='B.1' in aTest.py), content of B.1.py file
>>>being exacty the same as content of B.py, I get:
>>
>> As you seem to be aware, Python expects modules to have a 'nice' name
>> consisting of
>> legal_Python_indentifier.py.
>
> Which are ? Where to find this info ?
Check the Python Reference Manual.
>
>> If you evade this, you are a bit on your own
>> and may run into untested corner cases.
>
> Untested area contains bugs, that's why it's interesting to test them.
The only potential bug here is that perhaps python should have raised an
error when the import happened.
> To me, that's look to be a bug.
>
> Yannick
I think the bug is in how you understand Python, not in python.
Stephen
More information about the Python-list
mailing list