Can't call GdkWindow.raise() due to reserved word



Hi,

'raise' is reserved in Python, meaning that you can't call GdkWindow.raise:

>>> w = Gtk.Window()
>>> w.realize()
>>> w.get_window().raise()
  File "<stdin>", line 1
    w.get_window().raise()
                       ^
SyntaxError: invalid syntax


Workaround:

>>> getattr(w.get_window(), 'raise')()


PyGTK worked around this by calling the method raise_()

Is this a bug? If so, how should it be fixed? Should we implement
raise_() in the Gtk overrides with the above workaround? Or should
pygobject be automatically renaming methods based on such reserved
words?

I'm currently at a Sugar/GTK3 hackfest until Thursday; I'm happy to
work on fixing this issue myself but would first appreciate some
direction with the above questions.

Thanks
Daniel


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