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 xsip, 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.
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 xsip, 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.