Re: [Python-Dev] Supporting functools.singledispatch with classes.

2017-12-25 Thread Nick Coghlan
On 25 December 2017 at 12:32, Ethan Smith  wrote:
> So at the moment, I don't think it is possible to implement singledispatch
> on classmethod or staticmethod decorated functions.

I've posted this to the PR, but adding it here as well: I think this
is a situation very similar to the case with functools.partialmethod,
where you're going to need to write a separate
functools.singledispatchmethod class that's aware of the descriptor
protocol, rather than trying to add the functionality directly to
functools.singledispatch.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] (no subject)

2017-12-25 Thread Yogev Hendel
I don't know if this is the right place to put this,
but I've found the following lines of code results in an incredibly long
processing time.
Perhaps it might be of use to someone.

*import re*
*pat = re.compile('^/?(?:\\w+)/(?:[%\\w-]+/?)+/?$')*
*pat.match('/t/a-aa-aa-a-aa-aa-aa-aa-aa-aa./')*
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com