-
Notifications
You must be signed in to change notification settings - Fork 41
Wrap pydantic.dataclass; split interfaces.py into parts #118
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
Wrap pydantic.dataclass; split interfaces.py into parts #118
Conversation
|
Interesting. Can you explain why you made these changes? Everything passes without them as well, so why are they necessary? Let me first summarize what you did:
How did you determine that precisely these changes were needed, and is there something I can do that shows some check or test failing without these changes? I'm a bit uncomfortable with using the fake types from types.py with all those I have an open mind, but I can't read your mind regarding the motivation and scope of these changes. Thanks in advance for your explanation! |
it is a small functionally equivalent wrapper around
ok. I see your point and it is valid. I cut the dependencies and cirucular imports, but we loose the typesafety which is not good. OTOH interfaces.py is quite large and contains different aspects AFAIS: So would it make sense to incrementally split up intefaces.py into these different aspects and create own files for them ? |
|
Yeah, splitting interfaces.py makes sense to me. It was originally one file because the original author of the code (in TypeScript) wanted all public interfaces together, but I think that hasn't worked out as well as we had hoped. I'm okay exporting everything through interfaces but defining the different categories in different files, which interfaces then imports * from. Regarding data classes, I don't really like the idea of complicating code for the sake of something that may but probably won't happen in the future (look up YAGNI). I was hoping that the extra type-safety would show somewhere. E.g. areas that are untyped without the change becoming typed with it? Did you see any of that? |
typeagent/knowpro/types.py
Outdated
|
|
||
| from typing import Any, Generic, NotRequired, TypedDict, TypeVar | ||
|
|
||
| TMessageData = TypeVar("TMessageData") |
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.
Let's please use the modern notation for generics as used elsewhere in the codebase.
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 have added also instructions in AGENTS.md to assert the behavior
gvanrossum
left a comment
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.
Just one more nit and then I'm ready to approve.
suppress pyright warning reportUnsupportedDunderAll
|
@bmerkle Thanks for your patience! |
|
Thanks for your help and feedback. Appreciate a lot :-) |
Uh oh!
There was an error while loading. Please reload this page.