Message274669
The register() method should raise a TypeError if it's called with an object that's not a type.
Consider the following:
from functools import singledispatch
class C:
pass
obj = C()
@singledispatch
def foo(x):
print(foo.dispatch(x))
print("foo")
@foo.register(obj)
def bar(x):
print(foo.dispatch(x))
print("bar")
>>> foo(obj)
<function bar at 0x7f16f2adc9d8>
foo |
|
| Date |
User |
Action |
Args |
| 2016-09-06 23:43:10 | eryksun | set | recipients:
+ eryksun, rhettinger, ncoghlan, ethan.furman, amogorkon |
| 2016-09-06 23:43:10 | eryksun | set | messageid: <1473205390.6.0.624579100881.issue27984@psf.upfronthosting.co.za> |
| 2016-09-06 23:43:10 | eryksun | link | issue27984 messages |
| 2016-09-06 23:43:10 | eryksun | create | |
|