This wiki is in the process of being archived due to lack of usage and the resources necessary to serve it — predominately to bots, crawlers, and LLM companies. Edits are discouraged.
Pages are preserved as they were at the time of archival. For current information, please visit python.org.
If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list.
   1 ======================================
   2 doctest for path.py
   3 
   4 Uncomplete, and tests POSIX paths only
   5 ======================================
   6 
   7 >>> from mypath import path
   8 
   9 # Test root
  10 
  11 >>> path.ROOT
  12 path.ROOT
  13 
  14 >>> path.ROOT == path.ROOT
  15 True
  16 >>> path.ROOT < path.ROOT
  17 False
  18 >>> path.ROOT > path.ROOT
  19 False
  20 
  21 >>> path.ROOT == 'e'
  22 False
  23 >>> path.ROOT < 'h'
  24 True
  25 >>> path.ROOT > 'b'
  26 False
  27 >>> path.ROOT > 3
  28 Traceback (most recent call last):
  29 ...
  30 TypeError: Comparison not defined
  31 
  32 >>> 'a' == path.ROOT
  33 False
  34 >>> 'a' < path.ROOT
  35 False
  36 >>> 'a' > path.ROOT
  37 True
  38 >>> 3 > path.ROOT
  39 Traceback (most recent call last):
  40 ...
  41 TypeError: Comparison not defined
  42 
  43 
  44 # Basic path creation
  45 
  46 >>> path('/bin/arch')