classification
Title: Patch to remove unbound methods
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: christian.heimes, georg.brandl, gvanrossum
Priority: high Keywords: patch

Created on 2007-11-24 06:50 by christian.heimes, last changed 2008-01-06 22:29 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_remove_unbound.patch christian.heimes, 2007-11-24 06:50
py3k_remove_unbound_4.patch georg.brandl, 2007-11-24 20:53
Messages (10)
msg57798 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-24 06:50
Here is a first patch to remove unbound method objects.

6 tests failed:
    test_descr test_inspect test_pyclbr test_typechecks test_unittest
    test_weakref
msg57810 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-24 17:50
I'm waiting for those failing tests to magically start passing. :-)
msg57813 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-24 19:37
Do you still believe in the tooth fairy, too? :p
msg57814 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-24 20:16
Okay, this new patch takes care of test_pyclbr, test_inspect and
test_weakref.

test_unittest is a bit hard:

previously, calling loadTestsFromName with the name of a method would
create a test that runs that test case with that method being the test
method. With the name of a staticmethod though it would call the
staticmethod first and use the result of that call as the test case.

Now, there is no visible distinction between static methods and normal
methods anymore.
msg57815 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-24 20:29
Got test_typechecks too - the test is simply not applicable anymore.
msg57816 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-24 20:53
Okay, got test_descr too -- the problem was introduced by the patch
itself :)
msg57819 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-24 21:14
Georg Brandl wrote:
> Okay, got test_descr too -- the problem was introduced by the patch
> itself :)

Yes, I introduced the problem because I thought that sometimes is wrong
here. The question mark in <bound method ?.foo of <__main__.C object at
...>> doesn't look right.

Christian
msg57820 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-24 22:01
I think it is correct -- normally the __get__ call gets a second
argument of C.
msg57825 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-25 09:40
Fixed in r59183
unittest was pretty tricky.
msg57839 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-26 04:24
On Nov 24, 2007 11:37 AM, Christian Heimes <report@bugs.python.org> wrote:
> Do you still believe in the tooth fairy, too? :p

Yes, and in the Easter Bunny, Santa Claus, and Sinterklaas. But in
this particular case I believe in Kaboutertjes. (Dutch gnomes.) And it
turns out I was right. :-)
History
Date User Action Args
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2007-11-26 04:24:27gvanrossumsetmessages: + msg57839
2007-11-25 09:40:05christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg57825
2007-11-24 22:01:18georg.brandlsetmessages: + msg57820
2007-11-24 21:14:40christian.heimessetmessages: + msg57819
2007-11-24 20:53:19georg.brandlsetfiles: - py3k_remove_unbound_3.patch
2007-11-24 20:53:16georg.brandlsetfiles: - py3k_remove_unbound_2.patch
2007-11-24 20:53:12georg.brandlsetfiles: + py3k_remove_unbound_4.patch
messages: + msg57816
2007-11-24 20:29:00georg.brandlsetfiles: + py3k_remove_unbound_3.patch
messages: + msg57815
2007-11-24 20:16:32georg.brandlsetfiles: + py3k_remove_unbound_2.patch
nosy: + georg.brandl
messages: + msg57814
2007-11-24 19:37:46christian.heimessetmessages: + msg57813
2007-11-24 17:50:23gvanrossumsetmessages: + msg57810
2007-11-24 06:50:33christian.heimescreate