ANNOUNCE: cCopy 0.1

Robin Becker robin at jessikat.fsnet.co.uk
Sun Oct 1 17:55:41 EDT 2000


In article <sNJB5.66302$dZ2.23441951 at news3.rdc1.on.home.com>, Tom
<nospam at nospam.com> writes
>Robin,
>
>Thanks for cCopy.
>
>Browsing the code brings to some comments about the implementation and
>documentation of cCopy and copy.py.
>
>Some object types are described as 'atomics', some as 'special', and the
>rest aren't supported.  (It appears that the atomics don't actually get
>copied, but just have their reference counts increased.)
>
>The atomic types are:
>NoneType,IntType,LongType,FloatType,StringType,CodeType,TypeType,XRangeType,
>ClassType.
>The special types are: ListType,TupleType,DictionaryType,InstanceType.
>
>My Comments:
>
>- XRange isn't atomic, it is a compound.  I presume that the reason that it
>can be copied in this manner is because it is only composed of immutables?
>- Class & Code aren't atomic either.  To me they appear to belong with the
>other unsupported types in the un-named third category - those that don't
>really have a regular value and are composed entirely of special attributes.
>- Instances are not compound objects (as the other 'special' types are).  I
>suppose that it can be copied (unlike a similar type like a class) because
>multiple identical instances are allowed?
>
>It doesn't seem to me that the 'atomic/compound/no-value' trichotomy (is
>that a real word?) is really the issue for copying purposes, but I don't
>have a better alternative.
>
>I realize these weren't your decisions - I am just making these comments to
>see if my understanding of this module is accurate.
>
>Thanks,
>
>Tom.
...
I'm afraid I'm not privy to the decision making process about the
original copy module so (perhaps like you) I have only a vague
understanding of the real issues involved. I guess you're right wrt
xrange it's a structure type which is somehow a constant so gets copied
atomically.

Of course many have argued that the dichotomy of the immutables versus
everthing else is a bit artificial, but I only did the extension as a
speedup of the existing. It seems natural to me that 1.3 is atomic, but
others would clearly demand more generality.

I guess the bets that a mechanically minded moron like me can hope is
that my speedup duplicates the existing python module semanticas as
closely as possible.
-- 
Robin Becker



More information about the Python-list mailing list