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
d23617b3
Commit
d23617b3
authored
May 14, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declare ticker as int; made testbool generic for all numeric types
parent
4eb2168c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
Python/ceval.c
Python/ceval.c
+5
-7
No files found.
Python/ceval.c
View file @
d23617b3
...
...
@@ -162,7 +162,7 @@ eval_code(co, globals, locals, arg)
lineno
=
-
1
;
for
(;;)
{
static
ticker
;
static
int
ticker
;
/* Do periodic things */
...
...
@@ -983,16 +983,14 @@ static int
testbool
(
v
)
object
*
v
;
{
if
(
is_intobject
(
v
)
)
return
getintvalue
(
v
)
!=
0
;
if
(
is_floatobject
(
v
)
)
return
getfloatvalue
(
v
)
!=
0
.
0
;
if
(
v
==
None
)
return
0
;
if
(
v
->
ob_type
->
tp_as_number
!=
NULL
)
return
(
*
v
->
ob_type
->
tp_as_number
->
nb_nonzero
)(
v
)
;
if
(
v
->
ob_type
->
tp_as_sequence
!=
NULL
)
return
(
*
v
->
ob_type
->
tp_as_sequence
->
sq_length
)(
v
)
!=
0
;
if
(
v
->
ob_type
->
tp_as_mapping
!=
NULL
)
return
(
*
v
->
ob_type
->
tp_as_mapping
->
mp_length
)(
v
)
!=
0
;
if
(
v
==
None
)
return
0
;
/* All other objects are 'true' */
return
1
;
}
...
...
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