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

chore: fix typing issues #7

Closed
wants to merge 1 commit into from
Closed

chore: fix typing issues #7

wants to merge 1 commit into from

Conversation

Goldziher
Copy link

This PR fixes the typing issue of the return of cunkerify.

@umarbutler
Copy link
Owner

Wouldn’t this overwrite the signature of the chunker returned by chunkerify() in vscode? That’s what I’ve found. If I create a chunker with chunkerify() and then hover over that chunker, unless the output of chunkerify() is not type hinted, I will not be able to see its signature and docstring.

@Goldziher
Copy link
Author

Wouldn’t this overwrite the signature of the chunker returned by chunkerify() in vscode? That’s what I’ve found. If I create a chunker with chunkerify() and then hover over that chunker, unless the output of chunkerify() is not type hinted, I will not be able to see its signature and docstring.

It shouldn't, you had a typing issue. But more importantly - typing is more important than the editor completion you got, since it affects code used by the caller.

@umarbutler
Copy link
Owner

I'll try finding a solution that neither breaks typing nor code editor hints. Returning a custom object could be on the table with a __call__ method that ensures backwards compatibility with the current API.

@Goldziher
Copy link
Author

I'll try finding a solution that neither breaks typing nor code editor hints. Returning a custom object could be on the table with a __call__ method that ensures backwards compatibility with the current API.

I would suggest using a class that implements call in any case - since the code currently creates a huge function and uses its scope. it would be much cleaner to use a class with some private methods, and you could also consider than having both sync and async methods on the same class, or having subclasses of a base class.

@Goldziher Goldziher closed this by deleting the head repository Jun 26, 2024
umarbutler added a commit that referenced this pull request Jul 12, 2024
@umarbutler
Copy link
Owner

umarbutler commented Jul 12, 2024

I have fixed this in v2.2.0. I am still yet to get to #6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants