Skip to content

Add support for DLR types #72

Open

Description

@filmor

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

  1. filmor commented on Apr 20, 2015

    @filmor
    MemberAuthor

    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.

  2. den-run-ai commented on Apr 15, 2016

    @den-run-ai
    Contributor

    @filmor what is the use case for exposing DLR types in python?

  3. filmor commented on Apr 15, 2016

    @filmor
    MemberAuthor

    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.

  4. den-run-ai commented on Jun 13, 2016

    @den-run-ai
    Contributor

    @filmor can this be used to access dynamic attributes of COM objects? if yes, can you provide minimal example?

  5. den-run-ai commented on Sep 6, 2016

    @den-run-ai
    Contributor
  6. den-run-ai commented on Jul 5, 2017

    @den-run-ai
    Contributor

    @filmor how would you add support for IDynamicMetaObjectProvider?

  7. den-run-ai commented on Jul 5, 2017

    @den-run-ai
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions