Set a flag on the function or a global?

Ethan Furman ethan at stoneleaf.us
Mon Jun 15 20:53:01 EDT 2015


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.

--
~Ethan~



More information about the Python-list mailing list