code: def strict(*types):
      
  
      def decorate(func):
          @wraps(func)
          def wrapper(self, p):
              func(self, p)
              if not isinstance(p[0], types):
                  raise YAMLStrictTypeError(p[0], types, func)
  
          wrapper.co_firstlineno = func.__code__.co_firstlineno
          return wrapper
  
      return decorate
docs: Decorator, type check production rule output