summaryrefslogtreecommitdiffstats
path: root/library/cpp/pybind/v2.cpp
diff options
context:
space:
mode:
authorsay <[email protected]>2023-12-08 17:40:48 +0300
committersay <[email protected]>2023-12-08 19:58:59 +0300
commit914f57e3243f53dd89dd3adb4d8b6d35c47f46ce (patch)
tree98a1f1f1f5e2c38db3a78da10aeb7eb7d4e952e0 /library/cpp/pybind/v2.cpp
parente61293d91ee7c923944f627d8e1138bcb17cacad (diff)
Make support_retries() and get_type() methods of object instead of class ones. Reduce get_type_name() usage.
Diffstat (limited to 'library/cpp/pybind/v2.cpp')
-rw-r--r--library/cpp/pybind/v2.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/library/cpp/pybind/v2.cpp b/library/cpp/pybind/v2.cpp
deleted file mode 100644
index edce0be7195..00000000000
--- a/library/cpp/pybind/v2.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "v2.h"
-namespace NPyBind {
- namespace Detail {
- template <>
- PyTypeObject* GetParentType<void>(const TPyModuleDefinition&) {
- return nullptr;
- }
-
-
- template <bool InitEnabled>
- void UpdateClassNamesInModule(TPyModuleDefinition& M, const TString& name, PyTypeObject* pythonType) {
- if (!InitEnabled) {
- return;
- }
- M.ClassName2Type[name] = pythonType;
- }
-
- template <bool InitEnabled>
- void UpdateGetContextInModule(TPyModuleDefinition& M, const TString& name, IGetContextBase* base) {
- if (!InitEnabled) {
- return;
- }
- M.Class2ContextGetter[name] = base;
- }
-
- TPyModuleRegistry::TPyModuleRegistry() {
-#if PY_MAJOR_VERSION >= 3
- NPrivate::AddFinalizationCallBack([this]() {
- if (UnnamedModule) {
- UnnamedModule.Clear();
- }
- Name2Def.clear();
- });
-#endif
- }
- template void UpdateClassNamesInModule<false>(TPyModuleDefinition& M, const TString& name, PyTypeObject* pythonType);
- template void UpdateClassNamesInModule<true>(TPyModuleDefinition& M, const TString& name, PyTypeObject* pythonType);
-
-
- template void UpdateGetContextInModule<false>(TPyModuleDefinition& M, const TString& name, IGetContextBase* pythonType);
- template void UpdateGetContextInModule<true>(TPyModuleDefinition& M, const TString& name, IGetContextBase* pythonType);
- }//Detail
-}//NPyBind