Piet van Oostrum wrote:
>> Peter Otten <__pete...@web.de> (PO) wrote:
>
>>PO> Piet van Oostrum wrote:
This is perfectly normal.
>
>>PO> I'm not 100% sure of that.
>
> Why not?
What you quoted was not code I would /normally/ write. I was playing with
the context and meaning of y
> Peter Otten <__pete...@web.de> (PO) wrote:
>PO> Piet van Oostrum wrote:
>>>
>>> This is perfectly normal.
>PO> I'm not 100% sure of that.
Why not?
>PO> Just in case you didn't notice: I'm not the OP. The above piece of junk
>code
>PO> was my attempt to keep as close to the code he pos
Scott David Daniels wrote:
Piet van
Oostrum wrote:
Peter Otten <__pete...@web.de> (PO) wrote:
PO> $ cat x.py
PO> import sys
PO> globals().update(zip(*(range(110),)*2))
PO> y = 42
PO> print __name__
PO> if __name__ == "__main__":
PO> a = b = 42
PO> print len(dir())
PO> from x import y as z
Piet van Oostrum wrote:
>> Peter Otten <__pete...@web.de> (PO) wrote:
>
>>PO> $ cat x.py
>>PO> import sys
>>PO> globals().update(zip(*(range(110),)*2))
>>PO> y = 42
>>PO> print __name__
>>PO> if __name__ == "__main__":
>>PO> a = b = 42
>>PO> print len(dir())
>>PO> from x import y as z
>>P
Piet van Oostrum wrote:
Peter Otten <__pete...@web.de> (PO) wrote:
PO> $ cat x.py
PO> import sys
PO> globals().update(zip(*(range(110),)*2))
PO> y = 42
PO> print __name__
PO> if __name__ == "__main__":
PO> a = b = 42
PO> print len(dir())
PO> from x import y as z
PO> try:
PO> print my_n
> Peter Otten <__pete...@web.de> (PO) wrote:
>PO> $ cat x.py
>PO> import sys
>PO> globals().update(zip(*(range(110),)*2))
>PO> y = 42
>PO> print __name__
>PO> if __name__ == "__main__":
>PO> a = b = 42
>PO> print len(dir())
>PO> from x import y as z
>PO> try:
>PO> print my_name
>PO> ex
MRAB wrote:
> Marco wrote:
>> Hi,
>>
>> There happened something that I do not understand. Actually I don't even
>> know how it can be possible.
>>
>> I import a module and then the name space of the importing module seems
>> do be overwritten.
>>
>> my_name = __name__
>> print my_name
>> print
Glenn Hutchings wrote:
On Fri, 08 May 2009 19:14:52 +0200, Marco wrote:
I import a module and then the name space of the importing module seems do
be overwritten.
my_name = __name__
print my_name
print len(dir())
from x import y as z
print __name__
print len(dir())
print my_name
->
__main__
Marco wrote:
Hi,
There happened something that I do not understand. Actually I don't even
know how it can be possible.
I import a module and then the name space of the importing module seems do
be overwritten.
my_name = __name__
print my_name
print len(dir())
from x import y as z
print __n
Marco wrote:
Marco wrote:
Hi,
There happened something that I do not understand. Actually I don't even
know how it can be possible.
I import a module and then the name space of the importing module seems do
be overwritten.
my_name = __name__
print my_name
print len(dir())
from x import y
On Fri, 08 May 2009 19:14:52 +0200, Marco wrote:
> I import a module and then the name space of the importing module seems do
> be overwritten.
>
> my_name = __name__
> print my_name
> print len(dir())
> from x import y as z
> print __name__
> print len(dir())
> print my_name
>
> ->
> __main__
>
>
> Still I appreciate if someone could explain me why.
>
We can't without seeing the code. There shouldn't be any difference, so if
there is then its because your code is doing something to cause it-- break
it down to a runnable example and we may be able to tell you why, giving us
real code an
Stephen Hansen wrote:
>>
>> So what leads to the behavior that the .pyc is not created?
>>
>
> PYC's are only generated on import, they're never made for the main
> script.
>
> I personally like to keep my 'main script' very small. Largely just
> something which imports other modules and sends
>
> So what leads to the behavior that the .pyc is not created?
>
PYC's are only generated on import, they're never made for the main script.
I personally like to keep my 'main script' very small. Largely just
something which imports other modules and sends them along on their
business.
--S
--
Marco wrote:
> Hi,
>
> There happened something that I do not understand. Actually I don't even
> know how it can be possible.
>
> I import a module and then the name space of the importing module seems do
> be overwritten.
>
> my_name = __name__
> print my_name
> print len(dir())
> from x impo
Terry Reedy wrote:
> Marco wrote:
>> Hi,
>>
>> There happened something that I do not understand. Actually I don't even
>> know how it can be possible.
>>
>> I import a module and then the name space of the importing module seems
>> do be overwritten.
>>
>> my_name = __name__
>> print my_name
>
Marco wrote:
Hi,
There happened something that I do not understand. Actually I don't even
know how it can be possible.
I import a module and then the name space of the importing module seems do
be overwritten.
my_name = __name__
print my_name
print len(dir())
from x import y as z
print __n
Hi,
There happened something that I do not understand. Actually I don't even
know how it can be possible.
I import a module and then the name space of the importing module seems do
be overwritten.
my_name = __name__
print my_name
print len(dir())
from x import y as z
print __name__
print len(d
18 matches
Mail list logo