to clean up the namespace of my package I tried to implement a custom 
__dir__ function, as specified in PEP 562 
<https://peps.python.org/pep-0562/> (for another example see the answer to 
this SO question <https://stackoverflow.com/a/61984712/5238559>). 

in a nutshell, consider the setup below - this is working in python CLI 
3.7.10, but not in Spyder 5.2.1. I don't know enough about which mechanics 
are relevant here, so I thought I'd ask here first before filing a bug 
report

# module.py
__all__ = ['my_fun'] 

def __dir__(): 
    return __all__

def my_fun(args):
    pass
    #do stuff...

# main.py
import module
dir(module) ## should give ["my_fun"]

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to spyderlib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/spyderlib/6a1355cb-0e3d-43e2-9c3c-727d865bd57en%40googlegroups.com.

Reply via email to