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

Encoding object stub doesn't include __len__ #1556

Open
thearchitector opened this issue Jun 18, 2024 · 4 comments
Open

Encoding object stub doesn't include __len__ #1556

thearchitector opened this issue Jun 18, 2024 · 4 comments

Comments

@thearchitector
Copy link

thearchitector commented Jun 18, 2024

It looks like the Encoding object returned by Tokenizer.encode has the __len__ dunder method, and running len(encoding) works, but for some reason it's corresponding generated .pyi file does not. This causes type checking errors in Pyright/Pylance, even when running in non-strict mode (since this library isn't typed).

@ArthurZucker
Copy link
Collaborator

Ah I see. If you want to open a PR for a fix feel free to do so! Otherwise I'll do it when I have a bit of time!

@thearchitector
Copy link
Author

I can make a PR if you can point in me in the right direction. Otherwise, I have no problem waiting.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 22, 2024
@thearchitector
Copy link
Author

not stale

@github-actions github-actions bot removed the Stale label Jul 23, 2024
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

No branches or pull requests

2 participants