Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
65846c6c
Commit
65846c6c
authored
Nov 30, 2013
by
Alexandre Vassalotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #6477: Keep PyNotImplemented_Type and PyNone_Type private.
parent
19b6fa6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Include/object.h
Include/object.h
+2
-2
Modules/_pickle.c
Modules/_pickle.c
+2
-2
Objects/object.c
Objects/object.c
+6
-6
No files found.
Include/object.h
View file @
65846c6c
...
...
@@ -831,8 +831,8 @@ they can have object code that is not dependent on Python compilation flags.
PyAPI_FUNC
(
void
)
Py_IncRef
(
PyObject
*
);
PyAPI_FUNC
(
void
)
Py_DecRef
(
PyObject
*
);
PyAPI_DATA
(
PyTypeObject
)
PyNone_Type
;
PyAPI_DATA
(
PyTypeObject
)
PyNotImplemented_Type
;
PyAPI_DATA
(
PyTypeObject
)
_
PyNone_Type
;
PyAPI_DATA
(
PyTypeObject
)
_
PyNotImplemented_Type
;
/*
_Py_NoneStruct is an object of undefined type which can be used in contexts
...
...
Modules/_pickle.c
View file @
65846c6c
...
...
@@ -2853,13 +2853,13 @@ save_singleton_type(PicklerObject *self, PyObject *obj, PyObject *singleton)
static
int
save_type
(
PicklerObject
*
self
,
PyObject
*
obj
)
{
if
(
obj
==
(
PyObject
*
)
&
PyNone_Type
)
{
if
(
obj
==
(
PyObject
*
)
&
_
PyNone_Type
)
{
return
save_singleton_type
(
self
,
obj
,
Py_None
);
}
else
if
(
obj
==
(
PyObject
*
)
&
PyEllipsis_Type
)
{
return
save_singleton_type
(
self
,
obj
,
Py_Ellipsis
);
}
else
if
(
obj
==
(
PyObject
*
)
&
PyNotImplemented_Type
)
{
else
if
(
obj
==
(
PyObject
*
)
&
_
PyNotImplemented_Type
)
{
return
save_singleton_type
(
self
,
obj
,
Py_NotImplemented
);
}
return
save_global
(
self
,
obj
,
NULL
);
...
...
Objects/object.c
View file @
65846c6c
...
...
@@ -1459,7 +1459,7 @@ static PyNumberMethods none_as_number = {
0
,
/* nb_index */
};
PyTypeObject
PyNone_Type
=
{
PyTypeObject
_
PyNone_Type
=
{
PyVarObject_HEAD_INIT
(
&
PyType_Type
,
0
)
"NoneType"
,
0
,
...
...
@@ -1502,7 +1502,7 @@ PyTypeObject PyNone_Type = {
PyObject
_Py_NoneStruct
=
{
_PyObject_EXTRA_INIT
1
,
&
PyNone_Type
1
,
&
_
PyNone_Type
};
/* NotImplemented is an object that can be used to signal that an
...
...
@@ -1524,7 +1524,7 @@ notimplemented_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Py_RETURN_NOTIMPLEMENTED
;
}
PyTypeObject
PyNotImplemented_Type
=
{
PyTypeObject
_
PyNotImplemented_Type
=
{
PyVarObject_HEAD_INIT
(
&
PyType_Type
,
0
)
"NotImplementedType"
,
0
,
...
...
@@ -1567,7 +1567,7 @@ PyTypeObject PyNotImplemented_Type = {
PyObject
_Py_NotImplementedStruct
=
{
_PyObject_EXTRA_INIT
1
,
&
PyNotImplemented_Type
1
,
&
_
PyNotImplemented_Type
};
void
...
...
@@ -1597,10 +1597,10 @@ _Py_ReadyTypes(void)
if
(
PyType_Ready
(
&
PyList_Type
)
<
0
)
Py_FatalError
(
"Can't initialize list type"
);
if
(
PyType_Ready
(
&
PyNone_Type
)
<
0
)
if
(
PyType_Ready
(
&
_
PyNone_Type
)
<
0
)
Py_FatalError
(
"Can't initialize None type"
);
if
(
PyType_Ready
(
&
PyNotImplemented_Type
)
<
0
)
if
(
PyType_Ready
(
&
_
PyNotImplemented_Type
)
<
0
)
Py_FatalError
(
"Can't initialize NotImplemented type"
);
if
(
PyType_Ready
(
&
PyTraceBack_Type
)
<
0
)
...
...
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