Set a flag on the function or a global?
MRAB
python at mrabarnett.plus.com
Mon Jun 15 21:15:50 EDT 2015
On 2015-06-16 01:53, Ethan Furman wrote:
> On 06/15/2015 05:37 PM, Paul Rubin wrote:
>> Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
>>> Thoughts and feedback? Please vote: a module global, or a flag on the
>>> object? Please give reasons, and remember that the function is intended
>>> for interactive use.
>>
>> Both are bad. More state to remember, ugh. Instead have separate entry
>> points for filtering or not filtering the dunders. Something like:
>>
>> edir(obj) = no dunders
>> edir_(obj) = dunders.
>
> `edir_` ? What a horrible name. I hate trailing underscores. Too easy to miss.
>
Especially when there's also `edir`! :-)
More information about the Python-list
mailing list