FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/runtime/PythonTypes/PyInt.IComparable.cs at v3.1.0 · pythonnet/pythonnet · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
pythonnet
/
pythonnet
Public
Notifications
You must be signed in to change notification settings
Fork
780
Star
5.5k
Code
Issues
153
Pull requests
12
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
runtime
/
PythonTypes
/
PyInt.IComparable.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
136 lines (114 loc) · 3.84 KB
Breadcrumbs
pythonnet
/
src
/
runtime
/
PythonTypes
/
PyInt.IComparable.cs
Copy path
File metadata and controls
136 lines (114 loc) · 3.84 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using
System
;
namespace
Python
.
Runtime
;
partial
class
PyInt
:
IComparable
<
long
>
,
IComparable
<
int
>
,
IComparable
<
sbyte
>
,
IComparable
<
short
>
,
IComparable
<
ulong
>
,
IComparable
<
uint
>
,
IComparable
<
ushort
>
,
IComparable
<
byte
>
,
IEquatable
<
long
>
,
IEquatable
<
int
>
,
IEquatable
<
short
>
,
IEquatable
<
sbyte
>
,
IEquatable
<
ulong
>
,
IEquatable
<
uint
>
,
IEquatable
<
ushort
>
,
IEquatable
<
byte
>
,
IComparable
<
PyInt
?
>
,
IEquatable
<
PyInt
?
>
{
public
override
bool
Equals
(
object
o
)
{
using
var
_
=
Py
.
GIL
(
)
;
return
o
switch
{
long
i64
=>
this
.
Equals
(
i64
)
,
int
i32
=>
this
.
Equals
(
i32
)
,
short
i16
=>
this
.
Equals
(
i16
)
,
sbyte
i8
=>
this
.
Equals
(
i8
)
,
ulong
u64
=>
this
.
Equals
(
u64
)
,
uint
u32
=>
this
.
Equals
(
u32
)
,
ushort
u16
=>
this
.
Equals
(
u16
)
,
byte
u8
=>
this
.
Equals
(
u8
)
,
_
=>
base
.
Equals
(
o
)
,
}
;
}
#region Signed
public
int
CompareTo
(
long
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt64
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
int
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
short
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
sbyte
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
long
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt64
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
int
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
short
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
sbyte
other
)
{
using
var
pyOther
=
Runtime
.
PyInt_FromInt32
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
#endregion Signed
#region Unsigned
public
int
CompareTo
(
ulong
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
uint
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
ushort
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
int
CompareTo
(
byte
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
CompareTo
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
ulong
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
uint
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
ushort
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
public
bool
Equals
(
byte
other
)
{
using
var
pyOther
=
Runtime
.
PyLong_FromUnsignedLongLong
(
other
)
;
return
this
.
Equals
(
pyOther
.
BorrowOrThrow
(
)
)
;
}
#endregion Unsigned
public
int
CompareTo
(
PyInt
?
other
)
{
return
other
is
null
?
1
:
this
.
CompareTo
(
other
.
BorrowNullable
(
)
)
;
}
public
bool
Equals
(
PyInt
?
other
)
=>
base
.
Equals
(
other
)
;
}
Back
|
FazBrowse Home
|
New Git URL