code: def URL(base, path, segments=None, defaults=None):
      
      # Make a copy of the Segments class
      url_class = type(Segments.__name__, Segments.__bases__,
                       dict(Segments.__dict__))
      segments = [] if segments is None else segments
      defaults = [] if defaults is None else defaults
      # For each segment attach a property capable of getting and setting it
      for segment in segments:
          setattr(url_class, segment, url_class._segment(segment))
      # Instantiate the class with the actual parameters
      return url_class(base, path, segments, defaults)
docs: URL segment handler capable of getting and setting segments by name. The
      URL is constructed by joining base, path and segments.
  
      For each segment a property capable of getting and setting that segment is
      created dynamically.