parameters: (path)
docstring: >>> list(suffixes('/a/b/c'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a/b/c/'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a'))
      ['/a']
      >>> list(suffixes('/a/'))
      ['/a']
      >>> list(suffixes('/'))
      []
docstring_summary: >>> list(suffixes('/a/b/c'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a/b/c/'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a'))
      ['/a']
      >>> list(suffixes('/a/'))
      ['/a']
      >>> list(suffixes('/'))
      []
docstring_tokens: >>> list ( suffixes ( / a / b / c )) [ c b / c / a / b / c ] >>> list ( suffixes ( / a / b / c / )) [ c b / c / a / b / c ] >>> list ( suffixes ( / a )) [ / a ] >>> list ( suffixes ( / a / )) [ / a ] >>> list ( suffixes ( / )) []
function: def suffixes(path):
      """
      >>> list(suffixes('/a/b/c'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a/b/c/'))
      ['c', 'b/c', '/a/b/c']
      >>> list(suffixes('/a'))
      ['/a']
      >>> list(suffixes('/a/'))
      ['/a']
      >>> list(suffixes('/'))
      []
      """
      path = os.path.normpath(path)
  
      def up_dirs(cur_path):
          while os.path.dirname(cur_path) != cur_path:
              cur_path = os.path.dirname(cur_path)
              yield cur_path
  
      for x in up_dirs(path):
          yield path.replace(x + os.path.sep, '')
function_tokens: def suffixes ( path ) : path = os . path . normpath ( path ) def up_dirs ( cur_path ) : while os . path . dirname ( cur_path ) != cur_path : cur_path = os . path . dirname ( cur_path ) yield cur_path for x in up_dirs ( path ) : yield path . replace ( x + os . path . sep , '' )