On Mon, Nov 21, 2011 at 9:22 AM, Michael Foord
wrote:
> On 20/11/2011 21:41, Guido van Rossum wrote:
>>
>> On Sun, Nov 20, 2011 at 10:44 AM, Michael Foord
>> wrote:
>>>
>>> On 20 Nov 2011, at 16:35, Guido van Rossum wrote:
>>>
Um, what?! __class__ *already* has a special meaning. Those exam
On 20/11/2011 21:41, Guido van Rossum wrote:
On Sun, Nov 20, 2011 at 10:44 AM, Michael Foord
wrote:
On 20 Nov 2011, at 16:35, Guido van Rossum wrote:
Um, what?! __class__ *already* has a special meaning. Those examples
violate that meaning. No wonder they get garbage results.
The correct wa
On Sun, Nov 20, 2011 at 10:44 AM, Michael Foord
wrote:
>
> On 20 Nov 2011, at 16:35, Guido van Rossum wrote:
>
>> Um, what?! __class__ *already* has a special meaning. Those examples
>> violate that meaning. No wonder they get garbage results.
>>
>> The correct way to override isinstance is explai
On 20 Nov 2011, at 16:35, Guido van Rossum wrote:
> Um, what?! __class__ *already* has a special meaning. Those examples
> violate that meaning. No wonder they get garbage results.
>
> The correct way to override isinstance is explained here:
> http://www.python.org/dev/peps/pep-3119/#overloadin
Um, what?! __class__ *already* has a special meaning. Those examples
violate that meaning. No wonder they get garbage results.
The correct way to override isinstance is explained here:
http://www.python.org/dev/peps/pep-3119/#overloading-isinstance-and-issubclass
.
--Guido
On Sat, Nov 19, 2011 a
Michael Foord voidspace.org.uk> writes:
> The Python compiler can do strange things with assignment to __class__ in the
> presence of super. This issue has now been fixed, but it may be what is
> biting you:
>
> http://bugs.python.org/issue12370
>
> If this *is* the problem, then see the workarou
On 19 November 2011 23:11, Vinay Sajip wrote:
> Michael Foord voidspace.org.uk> writes:
>
> > That works fine in Python 3 (mock.Mock does it):
> >
> > >>> class Foo(object):
> > ... @property
> > ... def __class__(self):
> > ... return int
> > ...
> > >>> a = Foo()
> > >>> isinstance(a, i
Michael Foord voidspace.org.uk> writes:
> That works fine in Python 3 (mock.Mock does it):
>
> >>> class Foo(object):
> ... @property
> ... def __class__(self):
> ... return int
> ...
> >>> a = Foo()
> >>> isinstance(a, int)
> True
> >>> a.__class__
>
>
> There must be something else g
On 19/11/2011 22:06, Vinay Sajip wrote:
I was looking through the errors which occur when running the test suite of
Django's py3k branch under Python 3, and one particular set of errors caught my
eye which is unrelated to the bytes/str dance. These errors occur in some Django
utility code, which