mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-02 20:51:36 +00:00
Add casting operators between py::str / py::bytes
This commit is contained in:
@@ -72,3 +72,8 @@ cstats = ConstructorStats.get(ExamplePythonTypes)
|
||||
print("Instances not destroyed:", cstats.alive())
|
||||
instance = None
|
||||
print("Instances not destroyed:", cstats.alive())
|
||||
|
||||
print(instance.get_bytes_from_string().decode())
|
||||
print(instance.get_bytes_from_str().decode())
|
||||
print(instance.get_str_from_string())
|
||||
print(instance.get_str_from_bytes())
|
||||
|
||||
Reference in New Issue
Block a user