Re: [Python-ideas] A PEP to define basical metric which allows to guarantee minimal code quality

2017-09-14 Thread alexandre . galode
Hi, Thanks for your return, and link. I knew PyCQA but not the others. It seems i didn't success to precise my idea correctly. I'm 100% OK with you that this is not language role to indicate precisely which tools to use. But my idea is only to define basical metrics, useful to evaluate

Re: [Python-ideas] sys.py

2017-09-14 Thread Eric Snow
On Thu, Sep 14, 2017 at 4:26 PM, Victor Stinner wrote: > How do you crash Python? See https://bugs.python.org/issue31404. > Can't we fix the interpreter? I'm looking into it. In the meantime I've split the original branch up into 3. The first I've already landed.

Re: [Python-ideas] Make map() better

2017-09-14 Thread Neil Girdhar
For these examples, you shouldn't be using map at all. On Wednesday, September 13, 2017 at 11:10:39 AM UTC-4, Jason H wrote: > > The format of map seems off. Coming from JS, all the functions come > second. I think this approach is superior. > > Currently: > map(lambda x: chr(ord('a')+x),

Re: [Python-ideas] Make map() better

2017-09-14 Thread Nick Coghlan
On 15 September 2017 at 03:38, Antoine Rozo wrote: >> Why is it ','.join(iterable), why isn't there join(',', iterable) > > Because join apply on a string, and strings are defined by the str class, > not by a specific protocol (unlike iterables). Join actually used to

Re: [Python-ideas] A PEP to define basical metric which allows to guarantee minimal code quality

2017-09-14 Thread Nick Coghlan
On 15 September 2017 at 04:57, Alexandre GALODE wrote: > What are you thinking about this PEP idea? We don't really see it as the role of the language development team to formally provide direct advice on what tools people should be using to improve their development

Re: [Python-ideas] PEP 554: Stdlib Module to Support Multiple Interpreters in Python Code

2017-09-14 Thread Nick Coghlan
On 14 September 2017 at 08:25, Nick Coghlan wrote: > On 13 September 2017 at 20:45, Koos Zevenhoven wrote: >> It's still just *an* interpreter that happens to run __main__. And who says >> it even needs to be the only one? > > Koos, I've asked multiple

Re: [Python-ideas] sys.py

2017-09-14 Thread Victor Stinner
Le 14 sept. 2017 01:01, "Eric Snow" a écrit : In the case of sys.modules, the problem is that assigning a bogus value (e.g. []) can cause the interpreter to crash. It wasn't a problem until recently when I removed PyInterpreterState.modules and made sys.modules

Re: [Python-ideas] Make map() better

2017-09-14 Thread Antoine Rozo
> Why? I can iterate over a string. [c for c in 'abc'] It certainly behaves like one... I'd say this is inconsistent because there is no __iter__() and next() on the str class. Yes, strings are iterables. You can use a string as argument of str.join method. But only strings can be used as

Re: [Python-ideas] Make map() better

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 5:06 AM, Jason H wrote: > >>> Why is it ','.join(iterable), why isn't there join(',', iterable) > >> Because join apply on a string, and strings are defined by the str class, >> not by a specific protocol (unlike iterables). > Why? I can iterate over a

Re: [Python-ideas] Make map() better

2017-09-14 Thread Jason H
>> Why is it ','.join(iterable), why isn't there join(',', iterable)   > Because join apply on a string, and strings are defined by the str class, not > by a specific protocol (unlike iterables). Why? I can iterate over a string. [c for c in 'abc'] It certainly behaves like one... I'd say this

[Python-ideas] A PEP to define basical metric which allows to guarantee minimal code quality

2017-09-14 Thread Alexandre GALODE
Hi everybody, I'm a Python dev since about 10 years. I saw that customers are more and more curious about development process, talking from various reference on which allow to define what they call "good quality code". Someones are talking only about Pylint, other one from SonarQube, ... I

Re: [Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()

2017-09-14 Thread C Anthony Risinger
On Thu, Sep 14, 2017 at 8:07 AM, Steven D'Aprano wrote: > On Wed, Sep 13, 2017 at 12:24:31PM +0900, INADA Naoki wrote: > > I'm worring about performance much. > > > > Dict has ma_version from Python 3.6 to be used for future optimization > > including global caching. > >

Re: [Python-ideas] Make map() better

2017-09-14 Thread Antoine Rozo
> Why is it ','.join(iterable), why isn't there join(',', iterable) Because join apply on a string, and strings are defined by the str class, not by a specific protocol (unlike iterables). 2017-09-14 18:43 GMT+02:00 MRAB : > On 2017-09-14 03:55, Steven D'Aprano

Re: [Python-ideas] Hexadecimal floating literals

2017-09-14 Thread M.-A. Lemburg
All this talk about accurate representation left aside, please consider what a newbie would think when s/he sees: x = 0x1.fc000p-127 There's really no need to make Python scripts cryptic. It's enough to have a helper function that knows how to read such representations and we already

Re: [Python-ideas] Make map() better

2017-09-14 Thread MRAB
On 2017-09-14 03:55, Steven D'Aprano wrote: On Wed, Sep 13, 2017 at 11:05:26PM +0200, Jason H wrote: > And look, map() even works with all of them, without inheritance, > registration, and whatnot. It's so easy! Define easy. Opposite of hard or difficult. You want to map a function?

Re: [Python-ideas] Hexadecimal floating literals

2017-09-14 Thread Steven D'Aprano
On Wed, Sep 13, 2017 at 04:36:49PM +0200, Thibault Hilaire wrote: > Of course, for a lost of numbers, the decimal representation is simpler, and > just as accurate as the radix-2 hexadecimal representation. > But, due to the radix-10 and radix-2 used in the two representations, the > radix-2

Re: [Python-ideas] Make map() better

2017-09-14 Thread Mark E. Haase
On Wed, Sep 13, 2017 at 5:05 PM, Jason H wrote: > Python is weird in that there are these special magical globals that > operate on many things. Jason, that weirdness is actually a deep part of Python's philsophy. The language is very protocol driven. It's not just the built-in

Re: [Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 12:08 AM, Serhiy Storchaka wrote: > 13.09.17 23:07, Lucas Wiman пише: >> >> On Wed, Sep 13, 2017 at 11:55 AM, Serhiy Storchaka > > wrote: >> >> [...] Calling __getattr__() will slow down the access

Re: [Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()

2017-09-14 Thread Serhiy Storchaka
13.09.17 23:07, Lucas Wiman пише: On Wed, Sep 13, 2017 at 11:55 AM, Serhiy Storchaka > wrote: [...] Calling __getattr__() will slow down the access to builtins. And there is a recursion problem if module's __getattr__() uses

Re: [Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()

2017-09-14 Thread Steven D'Aprano
On Wed, Sep 13, 2017 at 12:24:31PM +0900, INADA Naoki wrote: > I'm worring about performance much. > > Dict has ma_version from Python 3.6 to be used for future optimization > including global caching. > Adding more abstraction layer may make it difficult. Can we make it opt-in, by replacing the