How about making a path object behave like a sequence of pathname components? Then * You can iterate over it directly instead of needing .parents() * p[:-1] gives you the dirname * p[-1] gives you the os.path.basename -- Greg