mirror of https://github.com/go-python/gopy.git
bind: test __repr__
This commit is contained in:
parent
7d90f62f3c
commit
59a16dec60
|
@ -30,6 +30,7 @@ print hi.Person.__doc__
|
||||||
print "--- p = hi.Person()..."
|
print "--- p = hi.Person()..."
|
||||||
p = hi.Person()
|
p = hi.Person()
|
||||||
print dir(p)
|
print dir(p)
|
||||||
|
print "--- p:", p
|
||||||
|
|
||||||
print "--- p.Name:", p.Name
|
print "--- p.Name:", p.Name
|
||||||
print "--- p.Age:",p.Age
|
print "--- p.Age:",p.Age
|
||||||
|
|
|
@ -80,6 +80,7 @@ Person is a simple struct
|
||||||
|
|
||||||
--- p = hi.Person()...
|
--- p = hi.Person()...
|
||||||
['Age', 'Greet', 'Name', 'String', '__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
|
['Age', 'Greet', 'Name', 'String', '__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
|
||||||
|
--- p: hi.Person{Name="", Age=0}
|
||||||
--- p.Name:
|
--- p.Name:
|
||||||
--- p.Age: 0
|
--- p.Age: 0
|
||||||
--- doc(hi.Greet):
|
--- doc(hi.Greet):
|
||||||
|
|
Loading…
Reference in New Issue