Title: Error when exposing a python method to .Net in python 2. · Issue #492 · pythonnet/pythonnet · GitHub
Open Graph Title: Error when exposing a python method to .Net in python 2. · Issue #492 · pythonnet/pythonnet
X Title: Error when exposing a python method to .Net in python 2. · Issue #492 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.3.0 Python version: 2.7.13 Operating System: Windows 10 Details We are trying to expose a python method in .Net, in a class that inherits from System.Object. We are following the example code in clr.py in...
Open Graph Description: Environment Pythonnet version: 2.3.0 Python version: 2.7.13 Operating System: Windows 10 Details We are trying to expose a python method in .Net, in a class that inherits from System.Object. We are...
X Description: Environment Pythonnet version: 2.3.0 Python version: 2.7.13 Operating System: Windows 10 Details We are trying to expose a python method in .Net, in a class that inherits from System.Object. We are...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/492
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when exposing a python method to .Net in python 2.","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.3.0\r\n- Python version: 2.7.13\r\n- Operating System: Windows 10\r\n\r\n### Details\r\n\r\nWe are trying to expose a python method in .Net, in a class that inherits from System.Object.\r\n\r\nWe are following the example code in clr.py in the pythonnet repository except that we are inheriting from System.Object and that we are using a namespace. When we run\r\n\r\n```python\r\nclass X(System.Object):\r\n __namespace__ = \"PyTest\"\r\n @clrmethod(int, [str])\r\n def test(self, x):\r\n return len(x)\r\n```\r\nwe get the error message\r\n\r\nTraceback (most recent call last):\r\n File \"test.py\", line 80, in \u003cmodule\u003e\r\n class X(System.Object):\r\nTypeError: Error when calling the metaclass bases\r\n Unable to find an entry point named 'PyIter_Check' in DLL 'python27'.\r\n\r\nThe error seems to be due to the fact that PyIter_Check is a #define statement and not a function in python. Therefore the import of the function fails in runtime.cs. The error does not occur in python 3 because PyIter_Check is not imported when python 3 is used.\r\n\r\n","author":{"url":"https://github.com/klasma","@type":"Person","name":"klasma"},"datePublished":"2017-06-14T14:15:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/492/pythonnet/issues/492"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8957607e-e7e3-2ace-2663-7cb050421b64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BC2:8B50E:76BBBA9:9944C30:69760077 |
| html-safe-nonce | 4bf27292eb55b0249d26676e05bbaca08c0ced7387e103f0a8f68a0ba7c12cd6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkMyOjhCNTBFOjc2QkJCQTk6OTk0NEMzMDo2OTc2MDA3NyIsInZpc2l0b3JfaWQiOiIxNDc3NzQ5MTI3MDU4NDIzOTI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8596ce45e67d170e6a95c9e46ce4f4714149d708bfd1e4ec11f27dd1a0409561 |
| hovercard-subject-tag | issue:235894302 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/492/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17537b9010cdb8825067b94e8afff87902536f36b3b865bab426d9aafcfa8001/pythonnet/pythonnet/issues/492 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17537b9010cdb8825067b94e8afff87902536f36b3b865bab426d9aafcfa8001/pythonnet/pythonnet/issues/492 |
| og:image:alt | Environment Pythonnet version: 2.3.0 Python version: 2.7.13 Operating System: Windows 10 Details We are trying to expose a python method in .Net, in a class that inherits from System.Object. We are... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | klasma |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6814b4cc7afd45cd6e64525d0cff0e76dd802f315a5b0e55a7abda1d1d070d0 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4ea235bfed58ef16c8a5642b3ac64b74f10c9f52 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width