Am Mon, 14 Feb 2011 11:23:10 +0100
schrieb Daniel Fetchinson <fet...@go...>:
> >
> > I've done a similar thing for other classes (not SQLObject) with
> > DeklaraticeMeta from SQLObject:
> >
> > classnr = 0
> >
> > class Base(object):
> > __metaclass__ = declarative.DeclarativeMeta
> > def __classinit__(cls, newattrs):
> > log.debug("%s.__classinit__" % cls)
> > global classnr
> > classnr = classnr + 1
>
> Sounds good, thanks! There is no global locking issue we need to worry
> about, right? I mean there is this global variable classnr.....
>
In my case the class creation is strictly serial, no
parallelism.
I am no expert in SQLObjects internals, but I think the class creation
of SQLObjects is also serial.
I know global smells, but I am pragmatic...
--
Greg
|