-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for provider overriding in litestar #120
fix for provider overriding in litestar #120
Conversation
d70db4e
to
b79c9e8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Flags with carried forward coverage won't be shown. Click here to find out more.
🚨 Try these New Features:
|
@nightblure It can be fixed by forbidding deepcopy of providers. Seems like litestar doing deepcopy of router or sth like that |
@vrslev @alexanderlazarev0 Hi! What do you think? Is it safe to redefine deepcopy method to forbid providers cloning? P.S. there is a problem with overriding in Litestar and I find out, that object in |
Actually, I encountered this exact issue recently)
I guess so, I don’t see any potential issues with it in our context. |
@@ -22,6 +24,9 @@ def __init__(self) -> None: | |||
super().__init__() | |||
self._override: typing.Any = None | |||
|
|||
def __deepcopy__(self, *_: object, **__: object) -> typing_extensions.Self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think very good decision will be to left here comment with reference to issue and reference to litestar behaviour. Because at some point it may be not so easy to understand why this decision is been made
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, thank you
No description provided.