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
418a1ef0
Commit
418a1ef0
authored
Feb 22, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RFE #1436243: make integers in [0..256] preallocated.
parent
df431657
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Lib/test/test_types.py
Lib/test/test_types.py
+4
-0
Objects/intobject.c
Objects/intobject.c
+1
-1
No files found.
Lib/test/test_types.py
View file @
418a1ef0
...
@@ -90,6 +90,10 @@ else: raise TestFailed, 'long() does not round properly'
...
@@ -90,6 +90,10 @@ else: raise TestFailed, 'long() does not round properly'
if
float
(
1
)
==
1.0
and
float
(
-
1
)
==
-
1.0
and
float
(
0
)
==
0.0
:
pass
if
float
(
1
)
==
1.0
and
float
(
-
1
)
==
-
1.0
and
float
(
0
)
==
0.0
:
pass
else
:
raise
TestFailed
,
'float() does not work properly'
else
:
raise
TestFailed
,
'float() does not work properly'
print
'6.4.1 32-bit integers'
print
'6.4.1 32-bit integers'
# Ensure the first 256 integers are shared
a
=
256
b
=
128
*
2
if
a
is
not
b
:
raise
TestFailed
,
'256 is not shared'
if
12
+
24
!=
36
:
raise
TestFailed
,
'int op'
if
12
+
24
!=
36
:
raise
TestFailed
,
'int op'
if
12
+
(
-
24
)
!=
-
12
:
raise
TestFailed
,
'int op'
if
12
+
(
-
24
)
!=
-
12
:
raise
TestFailed
,
'int op'
if
(
-
12
)
+
24
!=
12
:
raise
TestFailed
,
'int op'
if
(
-
12
)
+
24
!=
12
:
raise
TestFailed
,
'int op'
...
...
Objects/intobject.c
View file @
418a1ef0
...
@@ -62,7 +62,7 @@ fill_free_list(void)
...
@@ -62,7 +62,7 @@ fill_free_list(void)
}
}
#ifndef NSMALLPOSINTS
#ifndef NSMALLPOSINTS
#define NSMALLPOSINTS
100
#define NSMALLPOSINTS
257
#endif
#endif
#ifndef NSMALLNEGINTS
#ifndef NSMALLNEGINTS
#define NSMALLNEGINTS 5
#define NSMALLNEGINTS 5
...
...
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