[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-19 Thread Kyle Stanley
[re-sending this since I forgot to CC the list] > Unfortunately, there is no logging.loglevel attribute. > At the moment, the only way of doing this is modifying the program, parsing input parameters and setting up the logging system. Indeed, that's why I clarified in the follow-up message; sorr

[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-19 Thread Bar Harel
Thanks Kyle for the feedback :-) Unfortunately, there is no logging.loglevel attribute. At the moment, the only way of doing this is modifying the program, parsing input parameters and setting up the logging system. If you want it only temporarily for debugging purposes, or permanently for all s

[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-19 Thread Kyle Stanley
> This can already be done from the command line through --log=LEVEL, which sets the logging.loglevel attribute. In the how-to section of the docs, this is demonstrated in the following example: Note: "loglevel" is an arbitrary name, but this can be implemented trivially with something like argpar

[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-19 Thread Kyle Stanley
> Setting PYTHONLOGGING to any log level or level name will initialize logging.basicConfig() with that appropriate level. This can already be done from the command line through --log=LEVEL, which sets the logging.loglevel attribute. In the how-to section of the docs, this is demonstrated in the fo

[Python-ideas] PYTHONLOGGING env variable

2020-02-19 Thread Bar Harel
Another idea I've had that may be of use: PYTHONLOGGING environment variable. Setting PYTHONLOGGING to any log level or level name will initialize logging.basicConfig() with that appropriate level. Another option would be that -x dev or a different -x logging will initialize basic config. Will

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Ethan Furman
On 02/19/2020 08:55 AM, Soni L. wrote: On 2020-02-18 5:33 p.m., Soni L. wrote: Similar to len(). Just a [crappy] wrapper for __valid_getitem_requests__. Correction: Just a simple wrapper for __valid_getitem_requests__. Hopefully unsurprisingly, those words do not mean the same: simple: li

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Rhodri James
On 19/02/2020 16:55, Soni L. wrote: On 2020-02-18 5:33 p.m., Soni L. wrote: Similar to len(). Just a shitty wrapper for __valid_getitem_requests__. Correction: Just a simple wrapper for __valid_getitem_requests__. Thank you! :-) -- Rhodri James *-* Kynesim Ltd

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Soni L.
On 2020-02-18 5:33 p.m., Soni L. wrote: Similar to len(). Just a shitty wrapper for __valid_getitem_requests__. Correction: Just a simple wrapper for __valid_getitem_requests__. ___ Python-ideas mailing list -- python-ideas@python.org To unsubs

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Rhodri James
On 19/02/2020 00:26, Steven D'Aprano wrote: On Tue, Feb 18, 2020 at 08:44:07PM +, Rhodri James wrote: Language, sunshine. What about it? Just for the record, I had no issues with Soni's language, but I do object to attempts to shame him for it. This isn't the Disney Chanel, it's been ove

[Python-ideas] Re: Add __keys__ or __items__ protocol

2020-02-19 Thread Kyle Stanley
Serhiy Storchaka wrote: > 1. What special method should be added, `__keys__` or `__items__`? The > former returns keys, it needs to call `__getitem__` repeatedly to get > values. The latter returns key-value pairs, it does not need to call > `__getitem__`, but you should always pay the cost of cre

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Kyle Stanley
> Isn’t the point of having a Code of Conduct that we shouldn’t have to have these arguments? Or, if there is an argument about whether a single figurative use as a word qualifies as “excessive swearing” per the CoC, surely an -ideas thread isn’t the place to have it? Yeah, I very much doubt that

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Paul Moore
On Tue, 18 Feb 2020 at 23:40, Steven D'Aprano wrote: > > On Tue, Feb 18, 2020 at 09:04:21PM +, Paul Moore wrote: > > > This looks to me like Lua's `items()` function. > > I can't find that function listed anywhere. > > https://www.lua.org/manual/5.3/ > > Are you maybe thinking of `pairs()`? >