The absence of static typing of Python allows you to use and rely on classes without importing them. Should you import them anyway? Does it matter?
Example
someclass.py
class SomeClass:
def __init__(self, some_value):
self.some_value = some_value
someclient.py
class SomeClient:
def __init__(self, some_class_instance):
self.some_class_helper = some_class_instance
Here, the functionality SomeClientclearly depends on, SomeClassor at least on, how it behaves. However, someclient.py will work fine without import someclass. This is normal? It is wrong to use something without saying a word that you even use it.
source
share