GNOME Bugzilla – Bug 629727
CellLayout get_cells() empty list not undef
Last modified: 2011-10-03 15:08:15 UTC
Created attachment 170309 [details] [review] patch and test case When a CellLayout interfaced widget has no renderers I think get_cells() should return an empty list, not an undef. An undef return is rather inconvenient if doing a foreach ($viewer->get_cells). Perhaps per attached.
I agree that (undef) for no cells is definitely very inconvenient, and your patch corrects that. (And git puts the blame on me. :-/) But I worry about backwards compatibility. Is it conceivable that someone somewhere relies on (undef) signaling "no cells"?
As a boolean it's unchanged (new .t diff attached), if that helps. It seems unlikely that getting back a non-cell from get_cells could do anyone much good. My guess would be that nobody has done an empty get_cells before now and that returning undef instead of empty may be rated a bug.
Created attachment 170727 [details] [review] tests
I just pushed a patch to master that documents the unusual current return semantics of get_cells(). I feel that changing it like you proposed would be too risky. I'll try to make sure that Gtk3 gets this right.