Closed ssteinerx closed 2 years ago
Interesting, I'll look back at what I have.
That figuring out where sitecustomize.py (or usercustomize.py) actually can be put so it gets properly executed on startup on a multi-python and/or brew (linuxbrew) system is an absolute nightmare is a different issue and not one I'd expect python-devtools to address particularly.
Agreed, printing sys.path
can help a lot, we should add this to the docs too.
https://stackoverflow.com/questions/11181519/whats-the-difference-between-builtin-and-builtins
__builtins__
can be either the module or the dict in the same python version, depending on context.
Maybe we could add devtools.install()
to take care of this?
That would fit well with https://github.com/gruns/icecream#import-tricks and https://github.com/alexmojaki/snoop#install
But you can also just change the recommendation to import builtins; builtins.debug = debug
and that should work consistently, since this is Python 3 only.
See #108, I've added a tiny install
CLI.
https://python-devtools.helpmanual.io/usage/#usage-without-import
Suggests the following snippet:
In python 3.10 (at least, only version tried), referencing builtins directly gives "TypeError: 'module' object is not subscriptable"
builtins.dict, however, is subscriptable.
That figuring out where sitecustomize.py (or usercustomize.py) actually can be put so it gets properly executed on startup on a multi-python and/or brew (linuxbrew) system is an absolute nightmare is a different issue and not one I'd expect python-devtools to address particularly.