In article <[EMAIL PROTECTED]>,
Joe Strout <[EMAIL PROTECTED]> wrote:
> On Dec 9, 2008, at 4:31 AM, Brian Allen Vanderburg II wrote:
>
> > There is one situation where a module can be imported/executed
> > twice, if it is the __main__ module.
> Anyway, thanks for pointing this out; I bet it's
On Dec 9, 10:36 am, Joe Strout <[EMAIL PROTECTED]> wrote:
> On Dec 9, 2008, at 4:31 AM, Brian Allen Vanderburg II wrote:
>
> > There is one situation where a module can be imported/executed
> > twice, if it is the __main__ module.
>
> That's an excellent point -- this is something I've run into,
On Dec 9, 2008, at 4:31 AM, Brian Allen Vanderburg II wrote:
There is one situation where a module can be imported/executed
twice, if it is the __main__ module.
That's an excellent point -- this is something I've run into, and it
always feels a bit awkward to code around it. What's the stan
[EMAIL PROTECTED] wrote:
Unless you are calling reload() on the module, it will only ever get
_loaded_ once. Each additional import will just yield the existing
module. Perhaps if you post an example of the behavior that leads you
to believe that the class variables are getting reinitialized I c
In article
<[EMAIL PROTECTED]>,
alex23 <[EMAIL PROTECTED]> wrote:
> You might need to provide some more details about your code.
It's going to take me some time to generate a minimal test case.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Dec 8, 2008 at 11:44 PM, John Machin <[EMAIL PROTECTED]> wrote:
> On Dec 9, 3:36 pm, Matimus <[EMAIL PROTECTED]> wrote:
> > On Dec 8, 8:08 pm, Roy Smith <[EMAIL PROTECTED]> wrote:
> >
> > > I've got a class with a class variable:
> >
> > > class Foo:
> > >_map = {}
> >
> > > How do I m
On Dec 9, 3:36 pm, Matimus <[EMAIL PROTECTED]> wrote:
> On Dec 8, 8:08 pm, Roy Smith <[EMAIL PROTECTED]> wrote:
>
> > I've got a class with a class variable:
>
> > class Foo:
> > _map = {}
>
> > How do I make sure this only gets initialized the *first* time the
> > module containing the class is
On Dec 9, 2:08 pm, Roy Smith <[EMAIL PROTECTED]> wrote:
> I've got a class with a class variable:
>
> class Foo:
> _map = {}
>
> How do I make sure this only gets initialized the *first* time the
> module containing the class is imported? What appears to be happening
> as it stands is each time
On Dec 8, 8:08 pm, Roy Smith <[EMAIL PROTECTED]> wrote:
> I've got a class with a class variable:
>
> class Foo:
> _map = {}
>
> How do I make sure this only gets initialized the *first* time the
> module containing the class is imported? What appears to be happening
> as it stands is each time
I've got a class with a class variable:
class Foo:
_map = {}
How do I make sure this only gets initialized the *first* time the
module containing the class is imported? What appears to be happening
as it stands is each time the module gets imported, Foo._map get re-
initialized.
--
http://ma
10 matches
Mail list logo