Re: [Python-Dev] (no subject)

2017-12-26 Thread Franklin? Lee
On Tue, Dec 26, 2017 at 2:01 AM, Yogev Hendel wrote: > > 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+)/(?:[%\\

Re: [Python-Dev] Is static typing still optional?

2017-12-26 Thread Ned Batchelder
On 12/26/17 1:49 PM, Chris Barker wrote: On Sat, Dec 23, 2017 at 5:54 PM, Nick Coghlan > wrote: I still wonder about the "fields *must* be annotated" constraint though. I can understand a constraint that the style be *consistent* (i.e. all fields as annota

Re: [Python-Dev] Is static typing still optional?

2017-12-26 Thread Eric V. Smith
On 12/21/2017 6:36 AM, Ivan Levkivskyi wrote: On 21 December 2017 at 11:22, Terry Reedy > wrote: On 12/21/2017 4:22 AM, Eric V. Smith wrote: On 12/21/2017 1:46 AM, Chris Barker wrote: I suggest that it be clear in the docs, and ideally in the

Re: [Python-Dev] Is static typing still optional?

2017-12-26 Thread Ivan Levkivskyi
On 22 December 2017 at 20:55, Brett Cannon wrote: > > > On Fri, Dec 22, 2017, 11:38 Chris Barker, wrote: > >> On Fri, Dec 22, 2017 at 8:49 AM, Brett Cannon wrote: >> >>> I think it's worth reminding people that if they don't like the fact dataclasses (ab)use type hints for their succinct

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

2017-12-26 Thread Ivan Levkivskyi
On 26 December 2017 at 01:41, Nick Coghlan wrote: > 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

Re: [Python-Dev] (no subject)

2017-12-26 Thread MRAB
On 2017-12-26 07:01, Yogev Hendel wrote: 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.

Re: [Python-Dev] Is static typing still optional?

2017-12-26 Thread Chris Barker
On Sat, Dec 23, 2017 at 5:54 PM, Nick Coghlan wrote: > > I still wonder about the "fields *must* be annotated" constraint though. I > can understand a constraint that the style be *consistent* (i.e. all fields > as annotations, or all fields as field instances), since that's needed to > determine

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-26 Thread Benjamin Peterson
I imagine Cython already takes care of this? On Tue, Dec 26, 2017, at 02:16, Hugh Fisher wrote: > I have a Python program which generates the boilerplate code for > native extension modules from a Python source definition. > (http://bitbucket.org/hugh_fisher/fullofeels if interested.) > > The exa

[Python-Dev] Heap allocate type structs in native extension modules?

2017-12-26 Thread Hugh Fisher
I have a Python program which generates the boilerplate code for native extension modules from a Python source definition. (http://bitbucket.org/hugh_fisher/fullofeels if interested.) The examples in the Python doco and the "Python Essential Reference" book all use a statically declared PyTypeObje