Hello,

Based on a longer python history and no Qt experience, I'm just starting
with PyQt. My enthusiasm is a bit slowed down by the non-pythonic API:

a = QAction()
a.setEnabled(True)
enabled = a.isEnabled()

setting = QSettings()
filename = 'some.file'
qfilename = QVariant(QString(filename))
settings.setValue("LastFile", qfilename)
filename = settings.value("LastFile").toString()

Preferably these would look something like:

a = QAction()
a.enabled = True
enabled = a.enabled

settings = QSettings()
filename = 'some.file'
settings["LastFile"] = filename
filename = settings["LastFile"]


One thing here is the implicit use of __getitem__() and __setitem__()
instead of two different explicit functions. The other is a translation
of QVariant to string and vice versa.

- Are there any wrappers available that translate to a more
  pythonic API, i.e. not just direct bindings?
- Could SIP be extended to create these, i.e. would it be
  sane to have SIP extended to create these?
- Are there any plans to work towards a more pythonic API?
- Am I the only one getting cognitive dissonance when programming with
  the less pythonic versions?


best regards
florian

Attachment: pgpViI5LuG5Ms.pgp
Description: PGP signature

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to