GNOME Bugzilla – Bug 587637
propertyhelper does not allow negative float values
Last modified: 2009-11-22 16:24:41 UTC
The pygobject property helper erroneously disallows negative float or double values because of a mistake in the type checking. Steps to reproduce: >>> import gobject >>> gobject.property(type=float,minimum=-1) Traceback (most recent call last):
+ Trace 216300
self.type, self._get_minimum()))
Expected behavior: Negative minimum values should be allowed for float and double. The range checking for float values in gobject.propertyhelper.property._get_minimum is incorrect, the minimum float value is not G_MINFLOAT, it is -G_MAXFLOAT. G_MINFLOAT is zero. Likewise for G_DOUBLE which is the translated value for python float. The workaround is, obviously, to use __gproperties__ instead of the property helper.
Thank you for the report. Fixed in master.