[Patches] [ python-Patches-429614 ] pythonpath and optimize def. before init

noreply@sourceforge.net noreply@sourceforge.net
Fri, 08 Jun 2001 14:37:50 -0700


Patches item #429614, was updated on 2001-06-02 08:56
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=429614&group_id=5470

Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Frederic Giacometti (giacometti)
Assigned to: Nobody/Anonymous (nobody)
Summary: pythonpath and optimize def. before init

Initial Comment:

A) Addition of four functions
=====================

Py_{Set, Get}{PythonPath, OptimizeLevel}()
with the same semantics as Py_{Set, Get}ProgramName()

(Note: the C ANSI type 'char const*' is used to describe non-modifiable strings)

These four functions are needed in the next JPE runtime (Python 2.1 patch included in the 
distribution); this allows setting the PYTHONPATH and optimize level from Java property values.


B) Option '-P pythonpath' on the Python command line:
========================================

This option defines 'pythonpath' from the command line (and override the PYTHONPATH 
environment variable if necessary).

Usefullness: Sometimes, one does not want to rely on the environment variables, or modify them.

Sample application: Running build and test scripts in full control of the environment, and with 
different PYTHONPATH values.

This option is needed by the build and test scripts of the next JPE source distribution (Python 2.1 
patch included in the distribution.

Frederic Giacometti
fred@arakne.com


----------------------------------------------------------------------

>Comment By: Frederic Giacometti (giacometti)
Date: 2001-06-08 14:37

Message:
Logged In: YES 
user_id=93657


1) PEP: I am not in python-dev. What is the procedure for opening the PEP?

2) Override: I though about the question. My response was:
If you wnat concatenation, use:
   python -P "something:$PYTHONPATH"
or
  python -P "$PYTHONPATH:something"
That's for all the better...

3) I renamed Py_{Set,Get}OptimizeFlag to Py_{Set,Get}OtimizeLevel after I wrote the documentation. Glad 
you caught the typo :)), sorry :((
I changed 'Flag' to 'Level' because 'Flag' normally designates a binary variable (2 states) whereas what we 
are doing is actually defining a debuging level (3 levels as of now, but who knows that some more levels 
might be addes).
'OptimizeLevel' is more accurate and less ambiguous than 'OptimizeFlag'.

Frederic Giacometti


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-06-07 12:58

Message:
Logged In: YES 
user_id=21627

I think a PEP describing the exact rationale and nature of 
the change is required here. For example, why is it good 
that -P overrides PYTHONPATH, instead of combining both 
somehow?

Also, the documentation talks about Py_GetOptimizeLevel, 
whereas the header declares Py_GetOptimizeFlag.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=429614&group_id=5470