Message71225
I would add that making the comparison "right" for partial would be
trickier than it seems:
>>> from functools import partial
>>> type == type
True
>>> 1 == 1.0
True
>>> partial(type, 1)() == partial(type, 1.0)()
False
If partial(type, 1) and partial(type, 1.0) were to compare equal, it
would break the expectation, stated by Matt, that two equal function
objects produce the same results when given the same inputs.
PS:
>>> partial(type, 1)()
<type 'int'>
>>> partial(type, 1.0)()
<type 'float'> |
|
Date |
User |
Action |
Args |
2008-08-16 16:32:54 | pitrou | set | recipients:
+ pitrou, erickt, mgiuca |
2008-08-16 16:32:54 | pitrou | set | messageid: <1218904374.05.0.978202588434.issue3564@psf.upfronthosting.co.za> |
2008-08-16 16:32:53 | pitrou | link | issue3564 messages |
2008-08-16 16:32:52 | pitrou | create | |
|