What are the closest concepts in Python to namespace
and using
statements in C++?
The closest equivalent to the namespace
directive found in other languages is the Implicit Namespace Packages facility described in PEP 420 and introduced in Python 3.3. It allows for modules in multiple locations to be combined into a single, unified namespace rather than forcing the import of the first valid candidate found in sys.path
.
There is no direct equivalent of using
; importing specific names from a module adds them to the local scope unilaterally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With