Re: [Python-ideas] Allow not in lambda expressions

2019-03-27 Thread Brendan Barnwell
On 2019-03-26 23:29, Abdur-Rahmaan Janhangeer wrote: Suppose i have (lambda x: x if x != None else '')(someVar) returning an empty string if none but, if "not" was allowed (lambda x: x if x not None else '')(someVar) it might have been more elegant PROPOSAL: Allow "not" in lambda expression

Re: [Python-ideas] Allow not in lambda expressions

2019-03-27 Thread Abdur-Rahmaan Janhangeer
@Brendan unfortunately i've realised it. py sounded suddenly english. ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] singledispatch for methods

2019-03-27 Thread Tim Mitchell
The motivation is the same as for functools.singledispatch ( https://www.python.org/dev/peps/pep-0443/) - provide generic methods. These are useful for visitor implementations that are cleaner than the visit_ approach typically used today (e.g. https://github.com/mbr/visitor). It is also useful fo

Re: [Python-ideas] singledispatch for methods

2019-03-27 Thread Inada Naoki
On Wed, Mar 27, 2019 at 5:09 AM Tim Mitchell wrote: > > Is it time to add singledispatch for methods to the core library? > If so, would the methoddispatch implementation suffice or are there changes > you would like made? > singledispatchmethod will be added in Python 3.8. Please try Python 3.8

Re: [Python-ideas] Simpler thread synchronization using "Sticky Condition"

2019-03-27 Thread Richard Whitehead
Ben, Thanks very much for your reply. Everything you say is true, and the system can certainly be made to work (and without the performance problem I described) using only Condition variables. I think the correct version of my pseudo-code becomes: def sender(): while alive(): wa

Re: [Python-ideas] Simpler thread synchronization using "Sticky Condition"

2019-03-27 Thread Richard Whitehead
Thank you everyone who has commented on this issue, I've been overwhelmed by the helpfulness and thoughtfulness of the responses. In summary: * Condition variables work without problems provided you use them correctly, but using them correctly is quite tricky. * Using an event to achieve the s

[Python-ideas] Unified style of cache management API

2019-03-27 Thread Ma Lin
re module [1] and struct module [2] have module-level cache for compiled stuffs. Other third-party modules may also need cache for something. Do we need an unified cache management API like this? I suppose it's not mandatory, but welcome each module to use this API.   module.cache_get_capacity(

Re: [Python-ideas] Unified style of cache management API

2019-03-27 Thread Brett Cannon
On Wed, Mar 27, 2019 at 6:47 AM Ma Lin wrote: > re module [1] and struct module [2] have module-level cache for compiled > stuffs. > Other third-party modules may also need cache for something. > > Do we need an unified cache management API like this? > Need? No. Nice to have? Maybe. > I suppo

Re: [Python-ideas] Unified style of cache management API

2019-03-27 Thread Serhiy Storchaka
27.03.19 15:46, Ma Lin пише: re module [1] and struct module [2] have module-level cache for compiled stuffs. Other third-party modules may also need cache for something. Do we need an unified cache management API like this? I suppose it's not mandatory, but welcome each module to use this API.

[Python-ideas] New Project to Capture summaries from this list

2019-03-27 Thread Christopher Barker
Hi all, Inspired by Abdur-Rahmaan Janhangeer and some previous discussion son this list, I've started a project to capture some of the common threads from this list (and others). We often find ourselves saying things like "this was discussed on this list a year or so ago" when someone brings up a

Re: [Python-ideas] The Mailing List Digest Project

2019-03-27 Thread Abdur-Rahmaan Janhangeer
continuing a better effort here: https://github.com/PythonCHB/PythonListsSummaries moving to an impersonal repo later! Garanti sans virus. www.avast.com