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

Fix example and maybe add typing #40

Open
userappgate opened this issue Dec 15, 2022 · 2 comments
Open

Fix example and maybe add typing #40

userappgate opened this issue Dec 15, 2022 · 2 comments

Comments

@userappgate
Copy link

Hello,

I've started to use this project to annotate etag headers on downloaded files.

The example looks like it uses strings, but actually all strings get converted to bytes, so when reading it's all bytes… so initially it didn't match… because the type didn't match.

I understand that breaking API to just accept bytes and error out otherwise is maybe a bit much, but it'd be nice to have the examples use b'whatever' to reflect how it works.

Thanks

@jabbalaci
Copy link

The README should be updated to Python 3 IMO. And in Python 3 we get bytes, not strings. Example:

>>> import xattr
>>> xattr.listxattr("main.py")
[b'user.com.dropbox.attrs']

iustin added a commit that referenced this issue Feb 6, 2024
Only Python 3 is supported now, so this is way overdue. This addresses parts of issue #40.
@iustin
Copy link
Owner

iustin commented Feb 6, 2024

I don't know immediately whether one can add typing hints to C modules, or how easy/difficult it is, but the docstrings are easy to change.

The (temporary) output of the docs is here: https://pyxattr--46.org.readthedocs.build/46/module.html and looks about right, although there are a number of other Python 2-related comments to remove.

So I'll commit this docstring change first, and then look into the typing aspect.

iustin added a commit that referenced this issue Feb 6, 2024
Only Python 3 is supported now, so this is way overdue. This addresses parts of issue #40.
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

3 participants