You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
I have a simple class with a no-op decorator defined and I'm trying to use pinject to instantiate it, but haven't got this to work yet.
Python 3.8
pinject==0.14.1
class Controller:
def __init__(self, original_instance):
self.original_instance = original_instance
@Controller
class UsersController:
pass
users = obj_graph.provide(UsersController)
Trying to run this i get the following error:
example_python-3XnK4UKl\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 56103 --file Main.py
pydev debugger: process 33564 is connecting
Connected to pydev debugger (build 192.6817.19)
Traceback (most recent call last):
File "example_python/Main.py", line 29, in <module>
users = obj_graph.provide(UsersController)
File "example_python-3XnK4UKl\lib\site-packages\pinject\object_graph.py", line 193, in provide
support.verify_class_type(cls, 'cls')
File "example_python-3XnK4UKl\lib\site-packages\pinject\support.py", line 85, in verify_class_type
_verify_type(inspect.isclass, elt, arg_name, 'class')
File "example_python-3XnK4UKl\lib\site-packages\pinject\support.py", line 104, in _verify_type
raise errors.WrongArgTypeError(
pinject.errors.WrongArgTypeError: wrong type for arg cls: expected class but got Controller
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
I have a simple class with a no-op decorator defined and I'm trying to use pinject to instantiate it, but haven't got this to work yet.
Python 3.8
pinject==0.14.1
Trying to run this i get the following error:
The text was updated successfully, but these errors were encountered: