def peek_path_info(environ):
 segments = environ.get('PATH_INFO', '').lstrip('/').split('/', 1)
 if segments:
  return segments[0]

def peek_path_info ( environ ) : segments = environ . get ( 'PATH_INFO' , '' ) . lstrip ( '/' ) . split ( '/' , 1 ) if segments : return segments [ 0 ]
returns the next segment on the path_info or none if there is none .