Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-227

PythonOptimize and doc strings.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.3.1
    • None
    • core
    • None

    Description

      When PythonOptimize directive is used and set to "On", the effect is the same as if the options '-O -O' had been supplied to the 'python' executable. Because the highest level of optimisation is enabled, as well as basic optimisations being enabled, any doc strings in modules are discarded. This will cause a problem with any Python modules which make use of doc strings in the way they work. It is suspected for example that this may cause issues with running 'matplotlib'. See:

      http://www.modpython.org/pipermail/mod_python/2007-May/023641.html

      for further details.

      Because someone may want to enable optimisation but not have doc strings be discarded, the PythonOptimize directive should perhaps accept 'Basic' and 'Full' as options instead of just 'On'. For backward compatibility 'On' would equate to 'Full'.

      Note that the documentation is also wrong as it says that PythonOptimize is only equivalent to '-O'.

      Finally, it doesn't currently matter what you set as the value to PythonOptimize, it always turns the feature on, ie., even if you have:

      PythonOptimize Off

      The code should check for valid values.

      Attachments

        1. PythonOptimize.patch
          2 kB
          Toby White

        Activity

          People

            Unassigned Unassigned
            grahamd Graham Phillip Dumpleton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: