Date: 2013-04-18 11:18 pm (UTC)
winterkoninkje: shadowcrane (clean) (Default)
[preemptive tl;dr reply after the first couple paragraphs]

Earlier today I learned another new and horrible thing about Python's complete and utter lack of namespace hygiene. Namely: because modules are just dictionaries, the current module is too, which means that modules are just dictionaries stored in a local variable. This in turn means that if you use a local variable of the same name as the module you imported, it can squash the module import. There appears to be some black magic to try to hide this fact, which only makes it worse since it means top-level local variables don't cause the problem, but local variables in function definitions do!
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

chooseyourownlogic

April 2013

S M T W T F S
 123456
78910111213
14151617 181920
21222324252627
282930    

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 26th, 2017 08:39 am
Powered by Dreamwidth Studios