[Patches] [ python-Patches-1470504 ] partially fix test_class in p3yk

SourceForge.net noreply at sourceforge.net
Sat Apr 15 11:19:53 CEST 2006


Patches item #1470504, was opened at 2006-04-14 21:27
Message generated for change (Comment added) made by twouters
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1470504&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tests
Group: Python 3000
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Thomas Wouters (twouters)
Assigned to: Guido van Rossum (gvanrossum)
Summary: partially fix test_class in p3yk

Initial Comment:
Partially fix test_class in p3yk. This allows the test
to be actually run, although it could also be solved by
allowing 'exec' to receive any dict-like object
(there's a patch for that elsewhere, slated for 2.5, I
believe, but dictproxy objects would have to grow
setitem support for it to work.) Me, I prefer setattr()
like this over mucking with __dict__, although I have
to admit it did find a potential bug :) (The issue is
that class.__dict__ is a dictproxy object, if class is
a newstyle class.)

There are, however, more problems with test_class that
this doesn't resolve:

 - Classic classes that have a __cmp__ or __eq__
method, but no __hash__ method, are unhashable. The
same is not true for new-style classes. I'm not sure
whether that's a bug in new-style classes, or
desireable behaviour.

 - The recursive-__call__ test (where Ainst.__call__ ==
Ainst, so the hunt for the actual code to run is
recursive) crashes Python on my machine. The test
doesn't crash for classic classes. It seems to be a
stack overflow, or some other memory corruption scheme,
but I'll have to find me a machine with less address
space and memory to more comfortly debug this (talk
about a luxury problem!)

 - __coerce__ isn't being called. I don't recall
whether that's a newstyle-class issue, or a py3k
decision, or a bug. If it isn't a bug, output just has
to be regenerated.

 - Output has to be regenerated to pick up __truediv__
and __rtruediv__ instead of __div__ and __rdiv__.


----------------------------------------------------------------------

>Comment By: Thomas Wouters (twouters)
Date: 2006-04-15 11:19

Message:
Logged In: YES 
user_id=34209

Checked in this fix, still leaves the other issues open.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1470504&group_id=5470


More information about the Patches mailing list