code: def lim(self, lim):
          
          if lim is None:
              self._lim = lim
              return
  
          typeerror_msg = "lim must be of type tuple, float, None, or in ['fixed', 'symmetric', 'frame', 'sliding']"
  
          if isinstance(lim, str):
              if lim in ['fixed', 'symmetric', 'frame', 'sliding']:
                  self._lim = lim
                  return
              else:
                  raise ValueError(typeerror_msg)
  
          if isinstance(lim, int):
              lim = float(lim)
  
          if isinstance(lim, float):
              if lim <= 0.0:
                  raise ValueError("lim cannot be <= 0")
              self._lim = lim
              return
  
          if not isinstance(lim, tuple):
              try:
                  lim = tuple(lim)
              except:
                  raise TypeError(typeerror_msg)
  
          if not len(lim)==2:
              raise ValueError('lim must have length 2')
  
          for l in lim:
              if not (isinstance(l, float) or isinstance(l, int) or l is None):
                  raise ValueError("each item in limit must be of type float, int, or None")
  
          self._lim = lim
docs: set lim (limits)