[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Wes Turner
An IDE with support for PEP 484 / mypy / type annotations (and/or writing tests) can help minimize typing-related errors. https://github.com/python/typeshed/blob/master/stdlib/3/json/__init__.pyi https://github.com/python/mypy/blob/master/README.md#ide-linter-integrations-and-pre-commit On Wedne

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Wes Turner
Side q: Is there yet a way to get ? and/or ?? In IPython/Jupyter to list {typeshed,} annotations? On Thursday, November 28, 2019, Wes Turner wrote: > An IDE with support for PEP 484 / mypy / type annotations (and/or writing tests) can help minimize typing-related errors. > > https://github.com/py

[Python-ideas] Re: Calendar.year()

2019-11-28 Thread Wes Turner
IDK that a DeprecationWarning would be helpful or necessary? https://github.com/python/cpython/blob/02519f75d15b063914a11351da30178ca4ceb54b/Lib/calendar.py#L625 : ```python monthcalendar = c.monthdayscalendar prweek = c.prweek week = c.formatweek weekheader = c.formatweekheader prmonth = c.prmon

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Abdur-Rahmaan Janhangeer
It's about ambiguity. Maybe loads is short for load string which in english is also a verb. Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius On Thu, 28 Nov 2019, 12:38 Wes Turner, wrote: > An IDE with support for PEP 484 / mypy / type annotati

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Steven D'Aprano
On Thu, Nov 28, 2019 at 02:06:08PM +0400, Abdur-Rahmaan Janhangeer wrote: > It's about ambiguity. Maybe loads is short for load string which in english > is also a verb. True. It took me a long time to stop getting confused between pickle.load and .loads until I stopped reading it as "loads" and

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Abdur-Rahmaan Janhangeer
For the future, at least I happen to be teaching essential std lib modules this week, i had a headache with how naming goes on (i was looking at how a beginner would learn). Poor me, what could be an intuitive learning journey has some clogs down the road. Abdur-Rahmaan Janhangeer http://www.py

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Kyle Stanley
> I happen to be teaching essential std lib modules this week, i had a headache with how naming goes on (i was looking at how a beginner would learn). Poor me, what could be an intuitive learning journey has some clogs down the road. To some degree, that's an inevitable part of the learning proc

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Abdur-Rahmaan Janhangeer
"Designed With Learning in Mind" Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] h

[Python-ideas] Renaming json.load()

2019-11-28 Thread Wes Turner
Maybe methods for learning to search the code and docs (rather than memorizing APIs) would be a worthwhile exercise? # Python import json help(json) # IPython !pydoc json import json json? json?? # RTD: Read The Docs (and/or update the docs) https://docs.python.org/3/search.html?q=loads https:

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Ricky Teachey
I'd be +1 on adding a better named alias for loading strings to all of these libraries. Seems to me like it is a pretty awful naming convention even if it is standard across the profession, and that adding load_string or load_str as an alias for loads would be a Very Good Thing (TM) with few downs

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Stephen J. Turnbull
Abdur-Rahmaan Janhangeer writes: > "Designed With Learning in Mind" That's Python. Guido said so from the beginning, and in modern Python development we tend to favor full words with a consistent convention for separating them in multiword identifiers and so on. Syntax additions get fully bike

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Andrew Barnert via Python-ideas
On Nov 28, 2019, at 06:31, Ricky Teachey wrote: > > I'd be +1 on adding a better named alias for loading strings to all of these > libraries. Including the ones that aren’t in the stdlib? If so, how do we do that? If not, won’t it be even more confusing for people who learn json.load_string

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Steven D'Aprano
On Fri, Nov 29, 2019 at 12:55:13AM +0900, Stephen J. Turnbull wrote: > Abdur-Rahmaan Janhangeer writes: > > > "Designed With Learning in Mind" > > That's Python. Guido said so from the beginning, Is it? Did he? Do you have references for that? https://duckduckgo.com/?q=python+%22Designed+With

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Chris Angelico
On Fri, Nov 29, 2019 at 7:59 AM Steven D'Aprano wrote: > Off-topic: > > I'm consistently and frequently frustrated by the community's use of PEP > id numbers as jargon. I consider it to be a classic example of the use > of jargon to exclude, rather than the sense of using it to streamline > commun

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread MRAB
On 2019-11-28 20:51, Steven D'Aprano wrote: [snip] I'm consistently and frequently frustrated by the community's use of PEP id numbers as jargon. I consider it to be a classic example of the use of jargon to exclude, rather than the sense of using it to streamline communication. [snip] Apart

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Ricky Teachey
> > > I'd be +1 on adding a better named alias for loading strings to all of > these libraries. > > Including the ones that aren’t in the stdlib? If so, how do we do that? > Leading by example of not sticking forever with obfuscated naming. So the Very Good Thing isn’t actually as good... you ne

[Python-ideas] math.copysign not to introduce float

2019-11-28 Thread Marein
The math.copysign(x, y) function always returns a float, even when the given x is an int, i.e. math.copysign(3, -1) gives -3.0. This is documented behaviour, but I find it somewhat surprising given that the name suggests that it only copies a sign, and it's also annoying in situations when an int i

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Stephen J. Turnbull
Ricky Teachey writes: > Leading by example of not sticking forever with obfuscated naming. We do push back against obfuscated naming, including abbreviations like loads, but forward-looking, not backward-looking. There's also the problem in the stdlib that often a requirement for a module to be

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Stephen J. Turnbull
Steven D'Aprano writes: > On Fri, Nov 29, 2019 at 12:55:13AM +0900, Stephen J. Turnbull wrote: > > Abdur-Rahmaan Janhangeer writes: > > > > > "Designed With Learning in Mind" > > > > That's Python. Guido said so from the beginning, > > Is it? Did he? Do you have references for that? Y

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Abdur-Rahmaan Janhangeer
Education is one side of it. It's about intuitive API Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ide

[Python-ideas] Re: math.copysign not to introduce float

2019-11-28 Thread Guido van Rossum
In Python 2, returning an int where a float was expected could break existing code (since in Python 2 int and float behave differently under division), but in Python 3 int is virtually a subclass of float (see PEP 3141). So it's not a crazy idea. However, it's a bit of a slippery slope. Pretty muc

[Python-ideas] Re: Renaming json.load()

2019-11-28 Thread Christopher Barker
> > > And PEP numbers have a fourth purpose when used as jargon (this > applies to any numbered formal standard such as RFCs or ISO): they are > self-citing. In that sense, they are *inclusive*. They're an > invitation to learn more than you ever wanted to know about the things > the community ca