[Python-Dev] Re: Python is the only language with lack of const'ness in core, also affects: Re: PEP 622: Structural Pattern Matching

2020-07-08 Thread Rémi Lapeyre
> Le 8 juil. 2020 à 19:15, David Mertz a écrit : > > On Wed, Jul 8, 2020, 1:00 PM Paul Sokolovsky > Right. So, if someone would like to add something to this thread, I'd humbly > suggest to concentrate on the lack of, and need for, of const-ness in the > Python language core (in comparison

[Python-Dev] Re: Re Re: Recent PEP-8 change (Ivan Pozdeev)

2020-07-02 Thread Rémi Lapeyre
> Le 3 juil. 2020 à 00:32, Ivan Pozdeev via Python-Dev > a écrit : > > At https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_rebase_vs_merge > , > they say that the argument of whether to allow overwriting history

Re: [Python-Dev] int() and math.trunc don't accept objects that only define __index__

2019-03-15 Thread Rémi Lapeyre
Le 15 mars 2019 à 03:49:19, Steven D'Aprano (st...@pearwood.info(mailto:st...@pearwood.info)) a écrit: > On Wed, Mar 13, 2019 at 03:21:31AM -0700, Rémi Lapeyre wrote: > > > When __index__ is defined it means that there is a lossless conversion > > to int possible. In thi

Re: [Python-Dev] int() and math.trunc don't accept objects that only define __index__

2019-03-13 Thread Rémi Lapeyre
Le 22 février 2019 à 18:14:01, Nick Coghlan (ncogh...@gmail.com(mailto:ncogh...@gmail.com)) a écrit: > On Fri, 22 Feb 2019 at 18:29, Serhiy Storchaka wrote: > > Should we add default implementations of __float__ and __complex__ when > > either __index__ or __int__ is defined? Currently: > > > >

Re: [Python-Dev] int() and math.trunc don't accept objects that only define __index__

2019-02-19 Thread Rémi Lapeyre
Another point in favor of the change I just noticed is that int() accept objects defining __index__ as its `base` argument:     Python 3.7.2 (default, Jan 13 2019, 12:50:01)     [Clang 10.0.0 (clang-1000.11.45.5)] on darwin     Type "help", "copyright", "credits" or "license" for more

[Python-Dev] int() and math.trunc don't accept objects that only define __index__

2019-02-18 Thread Rémi Lapeyre
Hi, I open this thread to discuss the proposal by Nick Coghlan in https://bugs.python.org/issue33039 to add __int__ and __trunc__ to a type when __index__ is defined. Currently __int__ does not default to __index__ during class initialisation so both must be defined to get a coherant behavior:

[Python-Dev] Usage of tafile.copyfileobj

2018-11-24 Thread Rémi Lapeyre
Hi, I’m working on the tarfile module to add support for file objects whose size is not know beforehand (https://bugs.python.org/issue35227). In doing so, I need to adapt `tarfile.copyfileobj` to return the length of the file after it has been copied. Calling this function with `length=None`

[Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Rémi Lapeyre
on the issue ? Best regards, Rémi Lapeyre ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com