Skip to content
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

Merged
merged 9 commits into from
Aug 5, 2022
Merged

Typecats 2.0.0 #14

merged 9 commits into from
Aug 5, 2022

Conversation

xaviergmail
Copy link
Contributor

@xaviergmail xaviergmail commented Jul 29, 2022

Backwards compatibility for Cat.struc({"field": Wildcat(...)}) which worked with the legacy BaseConverter but no longer works with GenConverter

@xaviergmail xaviergmail marked this pull request as ready for review August 2, 2022 01:23
@xaviergmail xaviergmail changed the title [WIP] Typecats 2.0.0rc2 Typecats 2.0.0rc2 Aug 2, 2022
@@ -0,0 +1,39 @@
from typing import Callable, List, Optional, Tuple, Type, TypeVar, Union
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@xaviergmail xaviergmail force-pushed the chore/OP-1150-python-3-10 branch from 98b251b to bf1dfe5 Compare August 4, 2022 22:02
@xaviergmail xaviergmail changed the title Typecats 2.0.0rc2 Typecats 2.0.0 Aug 4, 2022
@xaviergmail xaviergmail merged commit 02c4420 into main Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants