Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2400

Pythonizing the examples

    XMLWordPrintable

Details

    • All

    Description

      A couple of examples in Qt for Python still use C++ syntaxing, idioms and coding styles. This user story relates to identifying and porting those examples to use Python styles and idoms (PEP 8).

      Some examples are:

      1. Changing cameCase to snake_case for variable names and functions names. Keep in mind that when overriding Qt-methods that are required by a class this cannot be done.
      2. Simplify loops: we often see c++ styled for loops and could be replaced by Python loops
      3. Usage of context when possible, avoid using f = open(...), and use with open(...) as f: instead.
      4. Use pathlib when possible
      5. You could optionally adopt the _feature_ module, and rely on a code without setters/getters, and snake_case Qt API. Read more

      Helpful Links:

      1. Python Styling Guide: https://peps.python.org/pep-0008/
      2. Get a list of non PEP8 issues of the code with Flake8 https://flake8.pycqa.org/en/latest/
      3. isort for ordering the import statements.
      4. Be mindful with using black, even when it's an amazing tool, some of the code we have can get formatted in a strange way, so if you are keen on using it, please do a manual check before submitting the change.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            shpremna Shyamnath Premnadh
            Cristian Maureira-Fredes Cristian Maureira-Fredes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes