[Python-ideas] Re: Cartesian Product on `__mul__`

2019-07-30 Thread Thomas Jollans
On 25/07/2019 19.41, Andrew Barnert via Python-ideas wrote: > On Jul 25, 2019, at 09:46, Batuhan Taskaya wrote: >> I think it looks very fine when you type {1, 2, 3} * {"a", "b", "c"} and get >> set(itertools.product({1, 2, 3}, {"a", "b", "c"})). So i am proposing set >> multiplication implement

Re: [Python-ideas] Support localization of unicode descriptions

2019-02-25 Thread Thomas Jollans
On 10/07/2018 23.20, David Mertz wrote: > The problem with non-canonical translations of the Unicode character > names is that there is not one unique possible rendering into language > X. Equally, I could find synonyms in general English for the names, but > one would be official, the others at be

Re: [Python-ideas] Is this PEP-able? "with" statement inside genexps / list comprehensions

2018-08-08 Thread Thomas Jollans
On 30/07/18 21:15, Rudy Matela wrote: > Hello, > > Do you think it would be nice to allow with statements inside genexps or > list comprehensions? The functions __enter__ and __exit__ would be > automatically called as iterables are traversed. I am thinking of > drafting a PEP about this. Examp

Re: [Python-ideas] Change repr of collections.OrderedDict to be more dict-like

2018-07-27 Thread Thomas Jollans
On 27/07/18 08:06, Robert Vanden Eynde wrote: Thanks for your response, I want to print/repr an OrderedDict() without relying on the fact that "dict are ordered" ie. I want a solution < python 3.7. Currently, if I do repr( OrderedDict([(1,2),(3,4)]) ), I get the string "OrderedDict([(1,2),(3,4)

Re: [Python-ideas] PEP 505: None-aware operators

2018-07-23 Thread Thomas Jollans
On 24/07/18 00:39, Chris Angelico wrote: > On Tue, Jul 24, 2018 at 8:22 AM, Thomas Jollans wrote: >> On 18/07/18 19:43, Steve Dower wrote: >>> When a ``None``-aware operator is present, the left-to-right evaluation >>> may be >>> short-circuited. For example,

Re: [Python-ideas] PEP 505: None-aware operators

2018-07-23 Thread Thomas Jollans
On 18/07/18 19:43, Steve Dower wrote: > When a ``None``-aware operator is present, the left-to-right evaluation > may be > short-circuited. For example, ``await a?.b(c).d?[e]`` is evaluated:: > >     _v = a >     if _v is not None: >     _v = _v.b >     _v = _v(c) >     _v = _v.d >    

Re: [Python-ideas] Adding Python interpreter info to "pip install"

2018-07-20 Thread Thomas Jollans
On 20/07/18 05:10, Al Sweigart wrote: > Sorry, I meant "pip list", rather than "pip info". > > I thought about the fact that "pip --version" provides this info, but 1) > it provides the location of pip, not the python interpreter it installs > packages for and 2) it would be an additional step for

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Thomas Jollans
orm doesn't provide pip by default, please do x" to > install it. With "" being plateform specific. Isn't pip installed by default on Windows and OSX? On Linux some distribution will probably do something unexpected and mess up your grand plan. > - c

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Thomas Jollans
On 2017-11-06 23:53, Ivan Pozdeev via Python-ideas wrote: > On 07.11.2017 1:48, Chris Barker wrote: >> On Mon, Nov 6, 2017 at 9:52 AM, Michel Desmoulin >> mailto:desmoulinmic...@gmail.com>> wrote: >> >> I know and you still: >> >> - have to use py -m on windows, python3 linux, python in vir

Re: [Python-ideas] Composition over Inheritance

2017-10-30 Thread Thomas Jollans
On 29/10/17 19:25, Soni L. wrote: > > > On 2017-10-29 02:57 PM, Brendan Barnwell wrote: >> On 2017-10-29 04:44, Soni L. wrote: >>> And this is how you miss the whole point of being able to dynamically >>> add/remove arbitrary components on objects you didn't create, at >>> runtime. >>> >>> Someon

Re: [Python-ideas] Composition over Inheritance

2017-10-28 Thread Thomas Jollans
On 28/10/17 14:19, Soni L. wrote: > > > On 2017-10-28 09:51 AM, Steven D'Aprano wrote: >> On Sat, Oct 28, 2017 at 09:09:30AM -0200, Soni L. wrote: >>> As recent threads indicate, composition may sometimes be better than >>> inheritance. And so I'd like to propose composition as a built-in >>> fea

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Thomas Jollans
On 2017-10-26 13:06, Yan Pas wrote: > I've looked up this feature in haskell. Dollar sign operator is used to > avoid parentheses. > > Rationalle: > Python tends to use functions instead of methods ( e.g.len([1,2,3]) > instead of [1,2,3].len() ). Sometimes the expression inside parentheses > may b

Re: [Python-ideas] Why not picoseconds?

2017-10-16 Thread Thomas Jollans
e Town >> to London. >> > Is that an African or a European swallow? It starts African, but it flips and can be observed as either African or European in London. It's a neutrino swallow. -- Thomas Jollans ___ Python-ideas mailing list P

Re: [Python-ideas] Restore the __members__ behavior to python3 for C extension writers

2017-06-19 Thread Thomas Jollans
On 2017-06-18 20:10, Barry Scott wrote: > What is the way to tell python about 'value' in the python3 world? Implement a __dir__ method. This should call the superclass' (e.g. object's) __dir__ and add whatever it is you want to add to the list. In general I'd recommend using properties for this

Re: [Python-ideas] Make functools.singledispatch register method return original function.

2017-06-17 Thread Thomas Jollans
On 17/06/17 23:27, Mital Ashok via Python-ideas wrote: > [snip] > So I'm suggesting that @function.register for single dispatch > functions returns the same function, so you would end up with > something like: > > @singledispatch > def fun(arg, verbose=True): > if verbose: > print("Let

Re: [Python-ideas] Define __fspath__() for NamedTemporaryFile and TemporaryDirectory

2017-06-16 Thread Thomas Jollans
On 16/06/17 22:21, Ethan Furman wrote: > On 06/16/2017 10:36 AM, Thomas Jollans wrote: >> On 08/06/17 15:42, Antoine Pietri wrote: >>> Hello everyone! >>> >>> A very common pattern when dealing with temporary files is code like >>> this: >>>

Re: [Python-ideas] Define __fspath__() for NamedTemporaryFile and TemporaryDirectory

2017-06-16 Thread Thomas Jollans
ss those directly to the library > functions instead of having to use the .name attribute explicitely. > > Thoughts? :-) > -- Thomas Jollans m ☎ +31 6 42630259 e ✉ t...@tjol.eu ___ Python-ideas mailing list Python-ideas@python.org https:/

Re: [Python-ideas] π = math.pi

2017-06-07 Thread Thomas Jollans
On 2017-06-07 02:03, Mikhail V wrote: > Greg Ewing wrote: > >> Steven D'Aprano wrote: >>> There's not much, if any, benefit to writing: >>> >>> ∫(expression, lower_limit, upper_limit, name) > >> More generally, there's a kind of culture clash between mathematical >> notation and programming n

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Thomas Jollans
On 04/06/17 00:04, Chris Angelico wrote: > On Sun, Jun 4, 2017 at 5:02 AM, Thomas Jollans wrote: >> On 03/06/17 20:41, Chris Angelico wrote: >>> [snip] >>> For reference, as well as the 948 Sm, there are 1690 Mn and 5777 So, >>> but only these characters ar

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Thomas Jollans
On 03/06/17 21:02, Thomas Jollans wrote: > On 03/06/17 20:41, Chris Angelico wrote: >> [snip] >> For reference, as well as the 948 Sm, there are 1690 Mn and 5777 So, >> but only these characters are valid from them: >> >> \u1885 Mn MONGOLIAN LETTER ALI GALI BALUDA

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Thomas Jollans
On 03/06/17 20:41, Chris Angelico wrote: > [snip] > For reference, as well as the 948 Sm, there are 1690 Mn and 5777 So, > but only these characters are valid from them: > > \u1885 Mn MONGOLIAN LETTER ALI GALI BALUDA > \u1886 Mn MONGOLIAN LETTER ALI GALI THREE BALUDA > ℘ Sm SCRIPT CAPITAL P > ℮ So

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Thomas Jollans
On 03/06/17 18:48, Steven D'Aprano wrote: > On Sun, Jun 04, 2017 at 02:36:50AM +1000, Steven D'Aprano wrote: > >> But Python 3.5 does treat it as an identifier! >> >> py> ℘ = 1 # should be a SyntaxError ? >> py> ℘ >> 1 >> >> There's a bug here, somewhere, I'm just not sure where... > That appears

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Thomas Jollans
]' /usr/share/X11/locale/en_US.UTF-8/Compose > : "Γ" U0393# GREEK CAPITAL LETTER GAMMA > : "π" U03C0# GREEK SMALL LETTER PI > : "τ" U03C4# GREEK SMALL LETTER T