Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sypport typeof(T) or clr.GetClrType #432

Closed
@vivainio

Description

@vivainio

In order to do reflection, you need to acquire the Type instance for imported class.

In C#, this is done by

Type t = typeof(MyClass)

In IronPython, this is done by

t = clr.GetClrType(MyClass)

Python.net seems to be missing this functionality.

I currently have this horrible hack, and I'm unsure how far it will work:

defget_clr_type(typ):""" simulate typeof(T) or GetClrType from IronPython.    Horrible hack, redo    """name=typ.__module__+"."+typ.__name__returnType.GetType(name)

For reference, code using this resides in:https://github.com/vivainio/pynetext/blob/master/pynetext.py

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp