GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Allow non-descriptor callables in `functools.singledispatchmethod` · Issue #140873 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionBug reportBug description:When a non-descriptor callable (such as a lambda or a class instance) is registered as a handler, import functools class MyCallable: def __call__(self, host_self, arg): return f"Handled {arg} via MyCallable" class Host: @functools.singledispatchmethod def my_method(self, arg): return f"Base handling for {arg}" callable_instance = MyCallable() Host.my_method.register(int, callable_instance) h = Host() h.my_method(123) AttributeError: 'MyCallable' object has no attribute '__get__'. Did you mean: '__ge__'? CPython versions tested on:3.12 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |