Пример #1
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         list(filter(None, [self.short, self.long])) + self.positionals,
         {
             "help": self.help
     })
Пример #2
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         [self.stream],
         {
             "should_close": self.should_close,
             "encoding": self.encoding,
             "errors": self.errors
         }
     )
Пример #3
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         [self.positional, self.mapping],
         {
             "metavar": self.metavar,
             "optional": self.optional,
             "remaining": self.remaining,
             "help": self.help
         }
     )
Пример #4
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         [self.path],
         {
             "mode": self.mode,
             "buffering": self.buffering,
             "encoding": self.encoding,
             "errors": self.errors,
             "newline": self.newline,
             "opener": self.opener
         }
     )
Пример #5
0
 def test_create_repr(self):
     self.assert_equal(create_repr("foo"), "foo()")
     self.assert_equal(create_repr("foo", ["bar", "baz"]), "foo('bar', 'baz')")
     self.assert_equal(create_repr("foo", kwargs={"spam": "eggs"}), "foo(spam='eggs')")
     self.assert_equal(create_repr("foo", ["bar", "baz"], {"spam": "eggs"}), "foo('bar', 'baz', spam='eggs')")
Пример #6
0
 def __repr__(self):
     return create_repr(self.__class__.__name__, kwargs=self.copy_args())
Пример #7
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         [self.argument, self.choices],
         Positional.copy_args(self)
     )
Пример #8
0
 def __repr__(self):
     return create_repr(
         self.__class__.__name__,
         [self.positionals, self.error_message],
         ConverterBase.copy_args(self)
     )