Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
pypy
Commits
3bd72bcbe792
Commit
4fb6c0d2
authored
May 26, 2014
by
Ronan Lamy
Browse files
create class SomeNone
parent
ef8c0505fc21
Changes
1
Hide whitespace changes
Inline
Side-by-side
rpython/annotator/model.py
View file @
3bd72bcb
...
...
@@ -505,6 +505,28 @@ class SomePBC(SomeObject):
else
:
return
kt
.
__name__
class
SomeNone
(
SomePBC
):
can_be_None
=
True
subset_of
=
None
knowntype
=
type
(
None
)
const
=
None
def
__init__
(
self
):
pass
def
isNone
(
self
):
return
True
@
property
def
descriptions
(
self
):
return
set
()
def
is_constant
(
self
):
return
True
def
is_immutable_constant
(
self
):
return
True
class
SomeConstantType
(
SomePBC
):
can_be_None
=
False
subset_of
=
None
...
...
@@ -557,7 +579,7 @@ class SomeImpossibleValue(SomeObject):
return
False
s_None
=
Some
PBC
([],
can_be_None
=
True
)
s_None
=
Some
None
(
)
s_Bool
=
SomeBool
()
s_Int
=
SomeInteger
()
s_ImpossibleValue
=
SomeImpossibleValue
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment