[Python-Dev] import curdir,pardir,sep,pathsep,defpath from relevant *path module

Skip Montanaro skip@pobox.com
Thu, 13 Feb 2003 15:49:31 -0600


It has always mystified me that os.{sep,pathsep} aren't defined in os.path.
Looking at os.py I see that os.{curdir,pardir,defpath} should probably live
there as well.

Proposal: Move the definitions of curdir, pardir, sep, pathsep and defpath
into the relevant path module (ntpath, posixpath, etc), then for
compatibility reimport them ("from path import curdir, pardir, sep, pathsep,
defpath") later in os.py.  Update the libref documentation to reflect these
items' new home.  Do whatever is necessary deprecation-wise (silent in 2.3?
Update usage in Python source after 2.3 release and add visible deprecation
in 2.4?).

Rationale: These variables are all path-related.  One of the reasons for
having platform-specific path modules is to allow programmers to manipulate
filesystem paths for platform X on platform Y.  This would make those items
available under that sort of scenario.  It would also reduce the amount of
platform-specific code in os.py.

Skip