Re: getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-13 Thread Armin Rigo
Hi Guido, On Wed, Jan 12, 2005 at 09:59:13AM -0800, Guido van Rossum wrote: The descriptor for __getattr__ and other special attributes could claim to be a data descriptor This has the nice effect that x[y] and x.__getitem__(y) would again be equivalent, which looks good. On the other hand, I

getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-12 Thread Alex Martelli
Since this bug isn't the cause of Fredrik's problem I'm changing the subject (and keep discussing the specific problem that Fredrik uncovered under the original subject). On 2005 Jan 12, at 05:11, Guido van Rossum wrote: ... I had exactly the same metabug in the pep 246 reference

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 23:20, Fredrik Lundh wrote: back in Python 2.1 (and before), an object could define how copy.copy should work simply by definining a __copy__ method. here's the relevant portion: ... try: copierfunction = _copy_dispatch[type(x)] except KeyError:

Re: [Python-Dev] copy confusion

2005-01-11 Thread Phillip J. Eby
At 11:56 PM 1/11/05 +0100, Alex Martelli wrote: What both issues? There's only one issue, it seems to me -- one of metaconfusion. I was relying on Fredrik's report of a problem with the code; that is the other issue I referred to. ___ Python-Dev

Re: [Python-Dev] copy confusion

2005-01-11 Thread Phillip J. Eby
At 02:58 PM 1/11/05 -0800, Guido van Rossum wrote: [Phillip] Looks like a bug to me; it breaks the behavior of classic classes, since type(classicInstance) returns InstanceType. I'm not so sure. I can't seem to break this for classic classes. Sorry; I was extrapolating from what I thought was