FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/runtime/generictype.cs at master · sdpython/pythonnet · GitHub
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
sdpython
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
runtime
/
generictype.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (33 loc) · 1.12 KB
Breadcrumbs
pythonnet
/
src
/
runtime
/
generictype.cs
Copy path
File metadata and controls
37 lines (33 loc) · 1.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
System
;
namespace
Python
.
Runtime
{
/// <summary>
/// Implements reflected generic types. Note that the Python behavior
/// is the same for both generic type definitions and constructed open
/// generic types. Both are essentially factories for creating closed
/// types based on the required generic type parameters.
/// </summary>
[
Serializable
]
internal
class
GenericType
:
ClassBase
{
internal
GenericType
(
Type
tp
)
:
base
(
tp
)
{
}
/// <summary>
/// Implements __new__ for reflected generic types.
/// </summary>
public
static
IntPtr
tp_new
(
IntPtr
tp
,
IntPtr
args
,
IntPtr
kw
)
{
Exceptions
.
SetError
(
Exceptions
.
TypeError
,
"cannot instantiate an open generic type"
)
;
return
IntPtr
.
Zero
;
}
/// <summary>
/// Implements __call__ for reflected generic types.
/// </summary>
public
static
IntPtr
tp_call
(
IntPtr
ob
,
IntPtr
args
,
IntPtr
kw
)
{
Exceptions
.
SetError
(
Exceptions
.
TypeError
,
"object is not callable"
)
;
return
IntPtr
.
Zero
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL