forked from pythonnet/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPythonTypeAttribute.cs
More file actions
27 lines (23 loc) · 879 Bytes
/
Copy pathPythonTypeAttribute.cs
File metadata and controls
27 lines (23 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
namespace Python.Runtime;
/// <summary>
/// Marks a property type with a specific python type. Normally, properties has .NET types, but if the property has a python type,
/// that cannot be represented in the propert type info, so this attribute is used to mark the property with the corresponding python type.
/// </summary>
public class PythonTypeAttribute : Attribute
{
/// <summary> Type name. </summary>
public string TypeName { get; }
/// <summary> Importable module name. </summary>
public string Module { get; }
/// <summary>
/// Creates a new instance of PythonTypeAttribute.
/// </summary>
/// <param name="pyTypeModule"></param>
/// <param name="pyTypeName"></param>
public PythonTypeAttribute(string pyTypeModule, string pyTypeName)
{
TypeName = pyTypeName;
Module = pyTypeModule;
}
}