Please be careful with type handling



Hi all!
  I hope that this message won't sound harsh or arrogant (especially
given my poor record of contributions to PyGObject), but instead be
taken as constructive criticism -- because that's my intention. :-)

I just filed https://bugzilla.gnome.org/show_bug.cgi?id=685860

It's not the first time that I run into a problem related to unsupported
types; PyGObject code is rich with switches that check for different
types, and it's extremely easy (and natural) that some types are forgotten.
I don't have a solution for this issue, but I still wanted to bring it
up, because being conscious about this problem might help developers and
reviewers working on new code.
For instance, the very issue which made me write this, is that the
commit which introduced the _pygi_hash_pointer_to_arg() function also
has the reverse function, _pygi_arg_to_hash_pointer(), which handles
more types, so the asymmetry was not hard to notice:

http://git.gnome.org/browse/pygobject/commit/?id=1c5d497d3c354f4d02f1d4570df2c61d6f47300c

I don't want to sound patronizing about it, given that I'm myself not a
very attentive person, but in some cases just being aware of this issue
might help in avoiding a few bugs.

Keep up the great work! :-)

Ciao,
  Alberto


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]