⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pyste-overload-policy.patch

📁 使用stl技术,(还没看,是听说的)
💻 PATCH
字号:
diff -Naur original/ClassExporter.py patched/ClassExporter.py
--- original/ClassExporter.py	Sat Jul 24 22:44:08 2004
+++ patched/ClassExporter.py	Sat Jul 24 22:21:55 2004
@@ -375,16 +375,21 @@
             method_info.policy = exporterutils.HandlePolicy(method, method_info.policy)
             
             # check for policies
-            policy = method_info.policy or ''
-            if policy:
-                policy = ', %s%s()' % (namespaces.python, policy.Code())
+            policy = method_info.policy or ''
+            policy_code = ''
+            if policy:
+                policy_code = '%s%s()' % (namespaces.python, policy.Code())
+                policy = ', %s' % policy_code
             # check for overloads
             overload = ''
             if method.minArgs != method.maxArgs and not method_info.wrapper:
                 # add the overloads for this method
                 DeclareOverloads(method)
                 overload_name = self.OverloadName(method)
-                overload = ', %s%s()' % (namespaces.pyste, overload_name)
+                overload = ', %s%s()' % (namespaces.pyste, overload_name)
+                if policy:
+                    overload += '[ %s ]' % policy_code
+                    policy = ''
         
             # build the .def string to export the method
             pointer = Pointer(method)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -