[Tutor] immutable objects

Premnath Sah prem.sah at gmail.com
Tue Oct 31 15:26:37 CET 2006


On 10/31/06, Kent Johnson <kent37 at tds.net> wrote:
>
> Premnath Sah wrote:
> > I would like to know how i can guarantee that a new immutable object is
> > infact a new object.
> >
> > Example:
> >
> >  >>> a = 1
> >  >>> b = 1
> >  >>> a is b
> > True
> >
> > is what i get. i want a and b to be two different object.
>
> I don't think there is any way to control this for the builtin types.
> Why do you care?


Im facing a problem with SOAPpy which checks for recursive objects using
id(obj).

In my case value for 2 SOAP headers are same and iam getting a recursion
error. if i pass different object with same value SOAPpy does not complain
(by using str(value) and unicode(value)).

Thanks

Premnath Sah T. H.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061031/32ab9164/attachment.html 


More information about the Tutor mailing list