Can't call GdkWindow.raise() due to reserved word
- From: Daniel Drake <dsd laptop org>
- To: python-hackers-list gnome org
- Subject: Can't call GdkWindow.raise() due to reserved word
- Date: Sun, 11 Dec 2011 15:46:15 -0600
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]