GeezerVison is showing github.com — Add support for DLR types · Issue #72 · pythonnet/pythonnet
Add support for DLR types #72
Description
Using this it's possible to implement all required functionality in a separate DLR meta-class. I've already tried to do this in Python but sadly the .NET types (or their representation in Python-space) are not patchable.
Activity
filmor commented on Apr 20, 2015
Indeed I have now found a way around this, check out this gist: https://gist.github.com/filmor/58f5099f96570c64b1d3
The implementation of the member access is done by basically translating the code that the C# compiler produces when accessing dynamic properties to Python.
Note: Strictly speaking this does not implement full support, as it only helps classes that derive from DynamicObject, not those that only implement IDynamicMetaObjectProvider.
Reacted by Denis Akhiyarov and jiajiawei
Reacted by Denis Akhiyarov and jiajiawei
den-run-ai commented on Apr 15, 2016
@filmor what is the use case for exposing DLR types in python?
filmor commented on Apr 15, 2016
My particular use case is a configuration library that allows for constructs like:
string proxy = c.proxy.http;
where c is a dynamic object of which the members are implicitly created by reading from the config. It allows us to pass partial configuration around easily and reduces string-littering.
den-run-ai commented on Jun 13, 2016
@filmor can this be used to access dynamic attributes of COM objects? if yes, can you provide minimal example?
den-run-ai commented on Sep 6, 2016
den-run-ai commented on Jul 5, 2017
@filmor how would you add support for IDynamicMetaObjectProvider?
den-run-ai commented on Jul 5, 2017
Metadata
Metadata
Development
No branches or pull requestsIssue actions