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
a13f4a11
Commit
a13f4a11
authored
Dec 10, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Decimal a subclass of Real and Inexact.
parent
968e68dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
29 deletions
+30
-29
Lib/decimal.py
Lib/decimal.py
+2
-1
Lib/test/output/test_cProfile
Lib/test/output/test_cProfile
+14
-14
Lib/test/output/test_profile
Lib/test/output/test_profile
+14
-14
No files found.
Lib/decimal.py
View file @
a13f4a11
...
...
@@ -134,6 +134,7 @@ __all__ = [
'setcontext'
,
'getcontext'
,
'localcontext'
]
import
numbers
as
_numbers
import
copy
as
_copy
# Rounding
...
...
@@ -509,7 +510,7 @@ def localcontext(ctx=None):
##### Decimal class #######################################################
class
Decimal
(
obje
ct
):
class
Decimal
(
_numbers
.
Real
,
_numbers
.
Inexa
ct
):
"""Floating point class for decimal arithmetic."""
__slots__
=
(
'_exp'
,
'_int'
,
'_sign'
,
'_is_special'
)
...
...
Lib/test/output/test_cProfile
View file @
a13f4a11
...
...
@@ -5,10 +5,10 @@ test_cProfile
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 1.000 1.000 <string>:1(<module>)
2 0.000 0.000 0.000 0.000 io.py:12
0
1(flush)
1 0.000 0.000 0.000 0.000 io.py:2
5
9(flush)
1 0.000 0.000 0.000 0.000 io.py:6
4
6(closed)
1 0.000 0.000 0.000 0.000 io.py:8
6
4(flush)
2 0.000 0.000 0.000 0.000 io.py:12
1
1(flush)
1 0.000 0.000 0.000 0.000 io.py:2
6
9(flush)
1 0.000 0.000 0.000 0.000 io.py:6
5
6(closed)
1 0.000 0.000 0.000 0.000 io.py:8
7
4(flush)
8 0.064 0.008 0.080 0.010 test_cProfile.py:103(subhelper)
28 0.028 0.001 0.028 0.001 test_cProfile.py:115(__getattr__)
1 0.270 0.270 1.000 1.000 test_cProfile.py:30(testfunc)
...
...
@@ -30,11 +30,11 @@ test_cProfile
Function called...
ncalls tottime cumtime
<string>:1(<module>) -> 1 0.270 1.000 test_cProfile.py:30(testfunc)
io.py:12
01(flush) -> 1 0.000 0.000 io.py:25
9(flush)
1 0.000 0.000 io.py:8
6
4(flush)
io.py:2
5
9(flush) ->
io.py:6
4
6(closed) ->
io.py:8
64(flush) -> 1 0.000 0.000 io.py:64
6(closed)
io.py:12
11(flush) -> 1 0.000 0.000 io.py:26
9(flush)
1 0.000 0.000 io.py:8
7
4(flush)
io.py:2
6
9(flush) ->
io.py:6
5
6(closed) ->
io.py:8
74(flush) -> 1 0.000 0.000 io.py:65
6(closed)
test_cProfile.py:103(subhelper) -> 16 0.016 0.016 test_cProfile.py:115(__getattr__)
test_cProfile.py:115(__getattr__) ->
test_cProfile.py:30(testfunc) -> 1 0.014 0.130 test_cProfile.py:40(factorial)
...
...
@@ -53,7 +53,7 @@ test_cProfile.py:89(helper2_indirect) -> 2 0.006 0.040
test_cProfile.py:93(helper2) -> 8 0.064 0.080 test_cProfile.py:103(subhelper)
8 0.000 0.008 {hasattr}
{exec} -> 1 0.000 1.000 <string>:1(<module>)
2 0.000 0.000 io.py:12
0
1(flush)
2 0.000 0.000 io.py:12
1
1(flush)
{hasattr} -> 12 0.012 0.012 test_cProfile.py:115(__getattr__)
{method 'append' of 'list' objects} ->
{method 'disable' of '_lsprof.Profiler' objects} ->
...
...
@@ -65,10 +65,10 @@ test_cProfile.py:93(helper2) -> 8 0.064 0.080
Function was called by...
ncalls tottime cumtime
<string>:1(<module>) <- 1 0.000 1.000 {exec}
io.py:12
0
1(flush) <- 2 0.000 0.000 {exec}
io.py:2
59(flush) <- 1 0.000 0.000 io.py:120
1(flush)
io.py:6
46(closed) <- 1 0.000 0.000 io.py:86
4(flush)
io.py:8
64(flush) <- 1 0.000 0.000 io.py:120
1(flush)
io.py:12
1
1(flush) <- 2 0.000 0.000 {exec}
io.py:2
69(flush) <- 1 0.000 0.000 io.py:121
1(flush)
io.py:6
56(closed) <- 1 0.000 0.000 io.py:87
4(flush)
io.py:8
74(flush) <- 1 0.000 0.000 io.py:121
1(flush)
test_cProfile.py:103(subhelper) <- 8 0.064 0.080 test_cProfile.py:93(helper2)
test_cProfile.py:115(__getattr__) <- 16 0.016 0.016 test_cProfile.py:103(subhelper)
12 0.012 0.012 {hasattr}
...
...
Lib/test/output/test_profile
View file @
a13f4a11
...
...
@@ -10,10 +10,10 @@ test_profile
12 0.000 0.000 0.012 0.001 :0(hasattr)
1 0.000 0.000 0.000 0.000 :0(setprofile)
1 0.000 0.000 1.000 1.000 <string>:1(<module>)
2 0.000 0.000 0.000 0.000 io.py:12
0
1(flush)
1 0.000 0.000 0.000 0.000 io.py:2
5
9(flush)
1 0.000 0.000 0.000 0.000 io.py:6
4
6(closed)
1 0.000 0.000 0.000 0.000 io.py:8
6
4(flush)
2 0.000 0.000 0.000 0.000 io.py:12
1
1(flush)
1 0.000 0.000 0.000 0.000 io.py:2
6
9(flush)
1 0.000 0.000 0.000 0.000 io.py:6
5
6(closed)
1 0.000 0.000 0.000 0.000 io.py:8
7
4(flush)
0 0.000 0.000 profile:0(profiler)
1 0.000 0.000 1.000 1.000 profile:0(testfunc())
8 0.064 0.008 0.080 0.010 test_profile.py:103(subhelper)
...
...
@@ -33,15 +33,15 @@ Function called...
:0(append) ->
:0(exc_info) ->
:0(exec) -> <string>:1(<module>)(1) 1.000
io.py:12
0
1(flush)(2) 0.000
io.py:12
1
1(flush)(2) 0.000
:0(hasattr) -> test_profile.py:115(__getattr__)(12) 0.028
:0(setprofile) ->
<string>:1(<module>) -> test_profile.py:30(testfunc)(1) 1.000
io.py:12
01(flush) -> io.py:25
9(flush)(1) 0.000
io.py:8
6
4(flush)(1) 0.000
io.py:2
5
9(flush) ->
io.py:6
4
6(closed) ->
io.py:8
64(flush) -> io.py:64
6(closed)(1) 0.000
io.py:12
11(flush) -> io.py:26
9(flush)(1) 0.000
io.py:8
7
4(flush)(1) 0.000
io.py:2
6
9(flush) ->
io.py:6
5
6(closed) ->
io.py:8
74(flush) -> io.py:65
6(closed)(1) 0.000
profile:0(profiler) -> profile:0(testfunc())(1) 1.000
profile:0(testfunc()) -> :0(exec)(1) 1.000
:0(setprofile)(1) 0.000
...
...
@@ -74,10 +74,10 @@ Function was called by...
test_profile.py:93(helper2)(8) 0.400
:0(setprofile) <- profile:0(testfunc())(1) 1.000
<string>:1(<module>) <- :0(exec)(1) 1.000
io.py:12
0
1(flush) <- :0(exec)(2) 1.000
io.py:2
59(flush) <- io.py:120
1(flush)(1) 0.000
io.py:6
46(closed) <- io.py:86
4(flush)(1) 0.000
io.py:8
64(flush) <- io.py:120
1(flush)(1) 0.000
io.py:12
1
1(flush) <- :0(exec)(2) 1.000
io.py:2
69(flush) <- io.py:121
1(flush)(1) 0.000
io.py:6
56(closed) <- io.py:87
4(flush)(1) 0.000
io.py:8
74(flush) <- io.py:121
1(flush)(1) 0.000
profile:0(profiler) <-
profile:0(testfunc()) <- profile:0(profiler)(1) 0.000
test_profile.py:103(subhelper) <- test_profile.py:93(helper2)(8) 0.400
...
...
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