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
a2185911
Commit
a2185911
authored
Jun 07, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #750595: Refer to type complex using builtin. Fixes #595837.
Backported to 2.2.
parent
6a380247
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Lib/copy_reg.py
Lib/copy_reg.py
+9
-3
No files found.
Lib/copy_reg.py
View file @
a2185911
...
@@ -28,10 +28,16 @@ def constructor(object):
...
@@ -28,10 +28,16 @@ def constructor(object):
# Example: provide pickling support for complex numbers.
# Example: provide pickling support for complex numbers.
def
pickle_complex
(
c
):
try
:
complex
except
NameError
:
pass
else
:
def
pickle_complex
(
c
):
return
complex
,
(
c
.
real
,
c
.
imag
)
return
complex
,
(
c
.
real
,
c
.
imag
)
pickle
(
type
(
1j
)
,
pickle_complex
,
complex
)
pickle
(
complex
,
pickle_complex
,
complex
)
# Support for pickling new-style objects
# Support for pickling new-style objects
...
...
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