Skip to content

Conversation

@Goldziher
Copy link

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

@umarbutler
Copy link
Collaborator

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
Collaborator

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
Collaborator

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