Skip to content
Advertisement

Tag: namespaces

Namespaces inside class in Python3

I am new to Python and I wonder if there is any way to aggregate methods into ‘subspaces’. I mean something similar to this syntax: I am writing an API wrapper and I’m going to have a lot of very similar methods (only different URI) so I though it would be good to place them in a few subspaces that

How to tell if Python module is a namespace module

In Python 3, modules can be namespace modules without an __init__.py (as per PEP 420) or as a regular module (i.e. ‘[modules] packages as they are implemented in Python 3.2 and earlier’ – PEP 420) that have an __init__.py or are a single .py file. How can you tell the difference between a namespace module and an ‘ordinary’ module? (I

Advertisement