mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-11 17:00:34 +00:00
Add handle::repr() method
This commit is contained in:
@@ -71,6 +71,12 @@ print(instance.get_bytes_from_str().decode())
|
||||
print(instance.get_str_from_string().encode().decode())
|
||||
print(instance.get_str_from_bytes().encode().decode())
|
||||
|
||||
class A(object):
|
||||
__str__ = lambda _: 'this is a str'
|
||||
__repr__ = lambda _: 'this is a repr'
|
||||
|
||||
instance.test_print(A())
|
||||
|
||||
from example import ConstructorStats
|
||||
|
||||
cstats = ConstructorStats.get(ExamplePythonTypes)
|
||||
|
||||
Reference in New Issue
Block a user