-
Notifications
You must be signed in to change notification settings - Fork 3
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
Typecats 2.0.0 #14
Typecats 2.0.0 #14
Conversation
typecats/exceptiongroups/__init__.py
Outdated
@@ -0,0 +1,39 @@ | |||
from typing import Callable, List, Optional, Tuple, Type, TypeVar, Union |
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.
unless you plan to make this module a lot larger than it is, you're better off having this be plain ol' typecats.exceptiongroups.py
. Usually it's best to leave __init__.py
for exports and not put real code in it if it can be avoided.
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.
Peter! 😄 Glad to hear from you, hope you're doing well! Thank you for your feedback on this. Writing code in __init__.py
has been a bit of a bad habit of mine which always felt wrong so thank you for the confirmation.
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 just happened to stumble across this and figured i'd give some unsolicted advice.
@@ -0,0 +1,133 @@ | |||
"""WARNING: This module is experimental. |
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.
you should probably put this under tests
. At least historically, we've avoided putting non-runtime dependencies within the main source directory. You run the risk of people getting ImportErrors
if they do anything you didn't expect.
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.
Yeah, this one's a bit tricky. I intend to use raises_in_group
in other projects' test suites which is why I included it here (also due to lack of interest in maintaining a separate package for only a few functions). My idea is that including pytest
in the module name would give people a pretty good idea of what to expect if they were to import it. Do you think this logic holds up? Since I'll be moving the exceptiongroups utils module into the root typecats package, I would have to do the same with this one. Perhaps prefixing it with an underscore-- typecats/_pytest_utils.py
?
If you feel like this doesn't belong here, I won't take offense! Perhaps something like the_truck is a better place for it?
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.
After some consideration I have decided that I don't want to maintain this as a public API. I'm sure that the Python community will come up with better utilities over time and I don't want to have to deprecate this in a public package whenever that happens.
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 just want to validate your comprehensive thought process here. I think in XOi's case, maybe the_truck
is the right place to put this, but either way, I can see now where you were going with this.
And yes, i agree that if you had decided to keep it here, putting it under a _
prefix would be a good plan to try to keep it out of everybody's way.
98b251b
to
bf1dfe5
Compare
Backwards compatibility for
Cat.struc({"field": Wildcat(...)})
which worked with the legacy BaseConverter but no longer works with GenConverter