Код: Выделить всё
E TypeError: 'module' object is not callable
Код: Выделить всё
├───src
│ └───company
│ ├───acc
│ └───dp
│ └───logic
│ ├───business
│ │ ├───__init__.py
│ │ ├───alter_customer.py
│ │ ├───filter_customer.py
│ │ └───review_customers.py
│ └───general
│ ├───some_function.py
│ └───__init__.py
├───tests
│ └───company
│ └───dp
│ └───logic
│ └───business
│ ├───test_alter_customer.py
│ └───test_review_customers.py
├───conftest.py
└───pyproject.toml
Представим себе файл filter_customer.py вот так. :
Код: Выделить всё
def filter_customer(i: int) -> int:
return i
Код: Выделить всё
from company.dp.logic.general import some_function
def review_customers() -> str:
x = some_function("custom")
return x
Код: Выделить всё
from company.dp.logic.business import filter_customer
def alter_customer() -> str:
x = filter_customer(10)
Подробнее здесь: [url]https://stackoverflow.com/questions/79102186/constant-error-while-referencing-function-in-package-typeerror-module-object[/url]