Re: Canonicalizing property names
- From: Martin Pitt <martin pitt ubuntu com>
- To: python-hackers-list gnome org
- Subject: Re: Canonicalizing property names
- Date: Thu, 1 Nov 2012 12:36:44 +0100
Daniel Drake [2012-10-31 13:13 -0600]:
> Working on https://bugzilla.gnome.org/show_bug.cgi?id=686942
> I need to revisit the canonicalize_key() calls made when
> setting/getting properties that are owned by gi.
>
> Can anyone explain the reasoning behind this, what it solves/avoids?
GLib properties usually use hyphens between the parts of the names,
but these aren't valid Python identifiers. So if you request a
property like "myobject.button_color" it needs to translate that into
requesting the "button-color" property from the actual GObject.
> Should it only be applied to properties which are owned by a class in
> the gi repository (as the code currently is) or should we be doing it
> for all properties (including those defined by the user at the Python
> level)?
I think it should apply to all properties; those defined at the Python
level should also use hyphen-style.
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]