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
ca810467
Commit
ca810467
authored
Aug 29, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of more coerce cruft (really check in this time :-)
parent
378b2c9a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
2 additions
and
57 deletions
+2
-57
Doc/api/refcounts.dat
Doc/api/refcounts.dat
+0
-4
Doc/lib/libfuncs.tex
Doc/lib/libfuncs.tex
+0
-6
Doc/tut/tut.tex
Doc/tut/tut.tex
+1
-1
Include/object.h
Include/object.h
+0
-1
Objects/longobject.c
Objects/longobject.c
+1
-17
Objects/object.c
Objects/object.c
+0
-27
Objects/typeobject.c
Objects/typeobject.c
+0
-1
No files found.
Doc/api/refcounts.dat
View file @
ca810467
...
...
@@ -712,10 +712,6 @@ PyNumber_And:PyObject*:o2:0:
PyNumber_Check:PyObject*:o:0:
PyNumber_Check:int:::
PyNumber_Coerce:int:::
PyNumber_Coerce:PyObject**:p1:+1:
PyNumber_Coerce:PyObject**:p2:+1:
PyNumber_Divide:PyObject*::+1:
PyNumber_Divide:PyObject*:o1:0:
PyNumber_Divide:PyObject*:o2:0:
...
...
Doc/lib/libfuncs.tex
View file @
ca810467
...
...
@@ -1228,12 +1228,6 @@ bypass these functions without concerns about missing something important.
argument).
\end{funcdesc}
\begin{funcdesc}
{
coerce
}{
x, y
}
Return a tuple consisting of the two numeric arguments converted to
a common type, using the same rules as used by arithmetic
operations. If coercion is not possible, raise
\exception
{
TypeError
}
.
\end{funcdesc}
\begin{funcdesc}
{
intern
}{
string
}
Enter
\var
{
string
}
in the table of ``interned'' strings and return
the interned string -- which is
\var
{
string
}
itself or a copy.
...
...
Doc/tut/tut.tex
View file @
ca810467
...
...
@@ -2696,7 +2696,7 @@ standard module \module{__builtin__}\refbimodindex{__builtin__}:
'UserWarning', 'ValueError', 'Warning', 'WindowsError',
'ZeroDivisionError', '
_
', '
__
debug
__
', '
__
doc
__
', '
__
import
__
',
'
__
name
__
', 'abs', 'basestring', 'bool', 'buffer',
'callable', 'chr', 'classmethod', 'cmp', 'co
erce', 'co
mpile',
'callable', 'chr', 'classmethod', 'cmp', 'compile',
'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',
'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',
...
...
Include/object.h
View file @
ca810467
...
...
@@ -395,7 +395,6 @@ PyAPI_FUNC(long) PyObject_Hash(PyObject *);
PyAPI_FUNC
(
int
)
PyObject_IsTrue
(
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_Not
(
PyObject
*
);
PyAPI_FUNC
(
int
)
PyCallable_Check
(
PyObject
*
);
PyAPI_FUNC
(
int
)
PyNumber_CoerceEx
(
PyObject
**
,
PyObject
**
);
PyAPI_FUNC
(
void
)
PyObject_ClearWeakRefs
(
PyObject
*
);
...
...
Objects/longobject.c
View file @
ca810467
...
...
@@ -3158,22 +3158,6 @@ long_or(PyObject *v, PyObject *w)
return
c
;
}
static
int
long_coerce
(
PyObject
**
pv
,
PyObject
**
pw
)
{
if
(
PyInt_Check
(
*
pw
))
{
*
pw
=
PyLong_FromLong
(
PyInt_AS_LONG
(
*
pw
));
Py_INCREF
(
*
pv
);
return
0
;
}
else
if
(
PyLong_Check
(
*
pw
))
{
Py_INCREF
(
*
pv
);
Py_INCREF
(
*
pw
);
return
0
;
}
return
1
;
/* Can't do it */
}
static
PyObject
*
long_long
(
PyObject
*
v
)
{
...
...
@@ -3330,7 +3314,7 @@ static PyNumberMethods long_as_number = {
long_and
,
/*nb_and*/
long_xor
,
/*nb_xor*/
long_or
,
/*nb_or*/
long_coerce
,
/*nb_coerce*/
0
,
/*nb_coerce*/
long_int
,
/*nb_int*/
long_long
,
/*nb_long*/
long_float
,
/*nb_float*/
...
...
Objects/object.c
View file @
ca810467
...
...
@@ -1273,33 +1273,6 @@ PyObject_Not(PyObject *v)
return
res
==
0
;
}
/* Coerce two numeric types to the "larger" one.
Increment the reference count on each argument.
Return value:
-1 if an error occurred;
0 if the coercion succeeded (and then the reference counts are increased);
1 if no coercion is possible (and no error is raised).
*/
int
PyNumber_CoerceEx
(
PyObject
**
pv
,
PyObject
**
pw
)
{
register
PyObject
*
v
=
*
pv
;
register
PyObject
*
w
=
*
pw
;
int
res
;
if
(
v
->
ob_type
->
tp_as_number
&&
v
->
ob_type
->
tp_as_number
->
nb_coerce
)
{
res
=
(
*
v
->
ob_type
->
tp_as_number
->
nb_coerce
)(
pv
,
pw
);
if
(
res
<=
0
)
return
res
;
}
if
(
w
->
ob_type
->
tp_as_number
&&
w
->
ob_type
->
tp_as_number
->
nb_coerce
)
{
res
=
(
*
w
->
ob_type
->
tp_as_number
->
nb_coerce
)(
pw
,
pv
);
if
(
res
<=
0
)
return
res
;
}
return
1
;
}
/* Test whether an object can be called */
int
...
...
Objects/typeobject.c
View file @
ca810467
...
...
@@ -2935,7 +2935,6 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
COPYNUM
(
nb_and
);
COPYNUM
(
nb_xor
);
COPYNUM
(
nb_or
);
COPYNUM
(
nb_coerce
);
COPYNUM
(
nb_int
);
COPYNUM
(
nb_long
);
COPYNUM
(
nb_float
);
...
...
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