forked from pythonnet/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintern_.tt
More file actions
58 lines (52 loc) · 964 Bytes
/
intern_.tt
File metadata and controls
58 lines (52 loc) · 964 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<#@ template debug="true" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#
string[] internNames = new string[]
{
"__name__",
"__dict__",
"__doc__",
"__class__",
"__module__",
"__file__",
"__slots__",
"__self__",
"__annotations__",
"__init__",
"__repr__",
"__import__",
"__builtins__",
"builtins",
"__overloads__",
"Overloads",
};
#>
using System;
namespace Python.Runtime
{
static class PyIdentifier
{
<#
foreach (var name in internNames)
{
#>
public static IntPtr <#= name #>;
<#
}
#>
}
static partial class InternString
{
private static readonly string[] _builtinNames = new string[]
{
<#
foreach (var name in internNames)
{
#>
"<#= name #>",
<#
}
#>
};
}
}