Re: [Python-ideas] PEP 8 update on line length

2019-02-19 Thread Nicolas Rolin
at does this variable represents ? -- *Nicolas Rolin* | Data Scientist + 33 631992617 - nicolas.ro...@tiime.fr *15 rue Auber, **75009 Paris* *www.tiime.fr <http://www.tiime.fr>* ___ Python-ideas mailing list Python-ideas@python.org https://mail.py

Re: [Python-ideas] Add "default" kwarg to list.pop()

2018-10-31 Thread Nicolas Rolin
uot;l = []" "(l or [None]).pop()" > 100 loops, best of 3: 0.421 usec per loop > > > > -- > Steve > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python

Re: [Python-ideas] Powerset

2018-10-16 Thread Nicolas Rolin
.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- -- *Nicolas Rolin* | Data Scientist + 33 631992617 - nicolas.ro...@tiime.fr *15 rue Auber, **75009 Paris* *www.tiime.fr <http://www.tiime.fr>* __

Re: [Python-ideas] f-string "debug" conversion

2018-10-03 Thread Nicolas Rolin
ad of just letting f expire. There IS a language > spec, and pretending there isn't one doesn't change that. > > ChrisA > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/lis

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-30 Thread Nicolas Rolin
gt; And that part of your proposal has not generated much controversy. >> Maybe if you proposed only that, you might get that change made? I >> haven't considered the ramifications of that because the discussions >> about -1 are obscuring it, but it might be relatively u

Re: [Python-ideas] Fix some special cases in Fractions?

2018-08-30 Thread Nicolas Rolin
ctions, I should import a specific math library whose specific job is to get this right (the same way if you want to do matrix stuff you have to import numpy). -- *Nicolas Rolin* ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.or

Re: [Python-ideas] Fwd: grouping / dict of lists

2018-07-13 Thread Nicolas Rolin
hat's what my prototype does if you pass a Mapping in (or use > .update() ) > > why not? > > -CHB > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way

Re: [Python-ideas] grouping / dict of lists

2018-07-03 Thread Nicolas Rolin
CHB semantics and syntax for the groupper object does everything that is needed, and even a little bit too much. It could be called AppendDict and just accept a (key, value) interable in input, and instead of doing dict[key] = value as a dict does, does dict[key] = [value] if key not in dict else dic

Re: [Python-ideas] grouping / dict of lists

2018-07-02 Thread Nicolas Rolin
')) >grouping(transactions, key=lambda v: 'debit' if v > 0 else 'credit') grouping(('debit' if v > 0 else 'credit', transaction_amount for transaction_amount in transactions)) The code is slightly more verbose, but it is akin to filter(iterable

Re: [Python-ideas] grouping / dict of lists

2018-07-02 Thread Nicolas Rolin
ax of the kind >grouping((food_type, food_name for food_type, food_name in foods)) which is pretty nice to have. -- Nicolas Rolin 2018-07-02 9:43 GMT+02:00 Michael Selik : > I made some heavy revisions to the PEP. Linking again for convenience. > https://github.com/selik/peps/blob/m

Re: [Python-ideas] Allow a group by operation for dict comprehension

2018-06-29 Thread Nicolas Rolin
he final object" property. But it doesn't requires me to defines 2 lambda functions just to do the job of a comprehension. -- Nicolas Rolin 2018-06-29 4:57 GMT+02:00 Michael Selik : > On Thu, Jun 28, 2018, 6:46 PM Nicolas Rolin > wrote: > >> The questions I should have

Re: [Python-ideas] Allow a group by operation for dict comprehension

2018-06-28 Thread Nicolas Rolin
yntax that is not too confusing ? My personal answer would be respectively "yes" and "maybe I don't know". I was hoping to have some views on the topic, and it seemed to have a bit sidetracked :) -- Nicolas Rolin ___ Python-idea

[Python-ideas] Allow a group by operation for dict comprehension

2018-06-28 Thread Nicolas Rolin
-357.0, -9.99, -15.6, 4320.0, -1200.0] splited_bank_transactions = {group_by('credit' if amount > 0 else 'debit'): amount for amount in bank_transactions} print(splited_bank_transactions) {'credit': [200.0, 4320.0], 'debit': [-357.0, -9.99, -15.6, -1200.0]} -- Nicolas Rolin ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/