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

Add generic typing to registry #69

Draft
wants to merge 4 commits into
base: v3
Choose a base branch
from
Draft

Conversation

dakinggg
Copy link
Contributor

@dakinggg dakinggg commented Feb 18, 2024

Not sure if this is something y'all are interested in adding, but I wanted to use catalogue with static typing on what the registry contains (Even though you've called it func everywhere, its quite useful to have other types in the registry). Thought I'd see if you wanted to upstream the typing change.

@dakinggg dakinggg marked this pull request as ready for review February 18, 2024 09:18
@@ -22,10 +23,14 @@ def create(*namespace: str, entry_points: bool = False) -> "Registry":
"""
if check_exists(*namespace):
raise RegistryError(f"Namespace already exists: {namespace}")
return Registry(namespace, entry_points=entry_points)

if generic_type is None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't exactly right...but I couldn't figure out how to get mypy to accept a direct default for the argument

@svlandeg svlandeg deleted the branch explosion:v3 March 22, 2024 09:58
@svlandeg svlandeg closed this Mar 22, 2024
@svlandeg svlandeg reopened this Mar 22, 2024
@svlandeg svlandeg marked this pull request as draft March 22, 2024 10:09
@svlandeg svlandeg changed the base branch from master to v3 March 22, 2024 10:31
@svlandeg svlandeg added the enhancement New feature or request label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants