[issue44346] Fraction constructor may accept spaces around '/'

2021-06-09 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > See previous discussion in #9574. Given this, probably spaces around '/' should be disallowed. -- ___ Python tracker ___ _

[issue44346] Fraction constructor may accept spaces around '/'

2021-06-08 Thread Mark Dickinson
Mark Dickinson added the comment: > I was surprised to realize `complex` doesn't accept '2 + 3j' See previous discussion in #9574. -- nosy: +mark.dickinson ___ Python tracker ___

[issue44346] Fraction constructor may accept spaces around '/'

2021-06-08 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: On Wed, Jun 09, 2021 at 06:18:22AM +, Vedran Čačić wrote: > I was surprised to realize `complex` doesn't accept '2 + 3j' Good catch, probably that should be allowed too. > e.g. how about 3_j? The PEP 515 added '_' as a separator between digits. But t

[issue44346] Fraction constructor may accept spaces around '/'

2021-06-08 Thread Vedran Čačić
Vedran Čačić added the comment: Of course, I'm for it. But we have to be consistent... I was surprised to realize `complex` doesn't accept '2 + 3j' (even though it accepts '(2+3j)', and even '\n2+3j\t'). There are a lot of slippery slopes here (e.g. how about 3_j?). I think that once we allow

[issue44346] Fraction constructor may accept spaces around '/'

2021-06-08 Thread Sergey B Kirpichev
New submission from Sergey B Kirpichev : Per https://bugs.python.org/msg394731 suggestion. For instance, mpq_set_str() does support this. Also, gmpy2.mpq(). Tentative patch attached. -- components: Library (Lib) files: fraction-spaces.diff keywords: patch messages: 395314 nosy: Serge