On Mon, May 17, 2010 at 02:28:30PM -0000, Jonathan Lange wrote:
> 2010/5/17 Björn Tillenius <email address hidden>:
> > If we see a test failing due to this, we can
> > quite easily make sure that it's really unique within an instance, by
> > keeping track of generated uuids.
> >
>
> Or you could drop the uuid approach and simply put id(self) into the
> string before the getUniqueInteger()-generated segment.
I'd rather stick with uuid, since id() seems to be to prone to generated
duplicates:
On Mon, May 17, 2010 at 02:28:30PM -0000, Jonathan Lange wrote: r()-generated segment.
> 2010/5/17 Björn Tillenius <email address hidden>:
> > If we see a test failing due to this, we can
> > quite easily make sure that it's really unique within an instance, by
> > keeping track of generated uuids.
> >
>
> Or you could drop the uuid approach and simply put id(self) into the
> string before the getUniqueIntege
I'd rather stick with uuid, since id() seems to be to prone to generated
duplicates:
>>> def foo(): Factory( )
... foo_factory = LaunchpadObject
... print id(foo_factory)
...
>>> foo()
124609680
>>> foo()
124609680
If I would have used id(self) and used the factory to create objects in
foo(), it would have failed the second time.
-- /launchpad. net/~bjornt
Björn Tillenius | https:/