@@ -341,10 +341,12 @@ NB_CORE const std::type_info *nb_type_info(PyObject *t) noexcept;
341
341
NB_CORE void *nb_inst_ptr (PyObject *o) noexcept ;
342
342
343
343
// / Check if a Python type object wraps an instance of a specific C++ type
344
- NB_CORE bool nb_type_isinstance (PyObject *obj, const std::type_info *t) noexcept ;
344
+ NB_CORE bool nb_type_isinstance (PyObject *obj, const std::type_info *t,
345
+ bool foreign_ok) noexcept ;
345
346
346
- // / Search for the Python type object associated with a C++ type
347
- NB_CORE PyObject *nb_type_lookup (const std::type_info *t) noexcept ;
347
+ // / Search for a Python type object associated with a C++ type
348
+ NB_CORE PyObject *nb_type_lookup (const std::type_info *t,
349
+ bool foreign_ok) noexcept ;
348
350
349
351
// / Allocate an instance of type 't'
350
352
NB_CORE PyObject *nb_inst_alloc (PyTypeObject *t);
@@ -386,6 +388,15 @@ NB_CORE void nb_inst_set_state(PyObject *o, bool ready, bool destruct) noexcept;
386
388
// / Query the 'ready' and 'destruct' flags of an instance
387
389
NB_CORE std::pair<bool , bool > nb_inst_state (PyObject *o) noexcept ;
388
390
391
+ // Set whether types will be shared with other binding frameworks by default
392
+ NB_CORE void nb_type_set_foreign_defaults (bool export_all, bool import_all);
393
+
394
+ // Teach nanobind about a type bound by another binding framework
395
+ NB_CORE void nb_type_import (PyObject *pytype, const std::type_info *cpptype);
396
+
397
+ // Teach other binding frameworks about a type bound by nanobind
398
+ NB_CORE void nb_type_export (PyObject *pytype);
399
+
389
400
// ========================================================================
390
401
391
402
// Create and install a Python property object
@@ -500,7 +511,8 @@ NB_CORE void print(PyObject *file, PyObject *str, PyObject *end);
500
511
typedef void (*exception_translator)(const std::exception_ptr &, void *);
501
512
502
513
NB_CORE void register_exception_translator (exception_translator translator,
503
- void *payload);
514
+ void *payload,
515
+ bool at_end);
504
516
505
517
NB_CORE PyObject *exception_new (PyObject *mod, const char *name,
506
518
PyObject *base);
0 commit comments