[Python-ideas] A shortcut to load a JSON file into a dict : json.loadf

2020-09-11 Thread The Nomadic Coder
Hi All, This is the first time I'm posting to this mailing group, so forgive me if I'm making any mistakes. So one of the most common ways to load json, is via a file. This is used extensively in data science and the lines. We often write something like :- with open(filename.json, "r") as f:

[Python-ideas] Re: A shortcut to load a JSON file into a dict : json.loadf

2020-09-11 Thread The Nomadic Coder
: A (non-exact)search for this construct in github (https://github.com/search?q=with+open+%3A+json.load=Code) gives 20million+ results. Seems like it's a popular set of statements that people use ... The Nomadic Coder ___ Python-ideas mailing list

[Python-ideas] Re: A shortcut to load a JSON file into a dict : json.loadf

2020-09-11 Thread The Nomadic Coder
How about load_from_path or loadp? I can understand that loadf is a bit misleading, you might think that it loads from a file-like object, but parses from a file instead. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Curious : Why staticmethod if classmethods can do everything a static method can?

2020-09-11 Thread The Nomadic Coder
This question is to further my understanding of the internals. It seems to me that a classmethod can do everything a staticmethod can, and additionally is not limited by inheritance. Why does python have them as two different constructs? ___

[Python-ideas] Re: A shortcut to load a JSON file into a dict : json.loadf

2020-09-11 Thread The Nomadic Coder
oops, was not aware of "not every three-line function needs to be a built-in" This came out personal frustration, as I use this 3 line function very, very often, and the whole community does. Still learning-to-navigate what's accepted here and what's not :)