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

Store X-* properties using Pythonic names #71

Open
da4089 opened this issue Oct 8, 2024 · 0 comments
Open

Store X-* properties using Pythonic names #71

da4089 opened this issue Oct 8, 2024 · 0 comments
Labels
debian Imported from Debian package bugs enhancement New feature or request

Comments

@da4089
Copy link

da4089 commented Oct 8, 2024

Import from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616592

python-vobject makes vCard/iCalendar properties available as object
attributes. It knows that while e.g. X-SIP might hold a contact's
SIP address and X-SIP is valid IANA syntax, the Python attributes
must be named x_sip, because the dash is not a valid character for
a Python identifier. It does this by mapping '_' to '-' in
getattr/setattr, so the attribute name inside the instance
(dict) actually contains a '-'.

There are tools in the Python universe that (rightfully) access e.g.
dict directly (e.g. ipython's tab completion, among others).
Those tools see the '-', which is not proper Python syntax.

I would think it were better if vobjects stored
properties/attributes using Pythonic names and converted them from
and to IANA rules on input and output respectively.

@da4089 da4089 added enhancement New feature or request debian Imported from Debian package bugs labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debian Imported from Debian package bugs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant