Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pickle_complex in copy_reg.py #37044

Closed
nnorwitz mannequin opened this issue Aug 16, 2002 · 5 comments
Closed

pickle_complex in copy_reg.py #37044

nnorwitz mannequin opened this issue Aug 16, 2002 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Aug 16, 2002

BPO 595837
Nosy @gvanrossum, @loewis, @arigo

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2003-06-07.20:12:13.000>
created_at = <Date 2002-08-16.03:28:45.000>
labels = ['library']
title = 'pickle_complex in copy_reg.py'
updated_at = <Date 2003-06-07.20:12:13.000>
user = 'https://bugs.python.org/nnorwitz'

bugs.python.org fields:

activity = <Date 2003-06-07.20:12:13.000>
actor = 'loewis'
assignee = 'nnorwitz'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2002-08-16.03:28:45.000>
creator = 'nnorwitz'
dependencies = []
files = []
hgrepos = []
issue_num = 595837
keywords = []
message_count = 5.0
messages = ['12014', '12015', '12016', '12017', '12018']
nosy_count = 4.0
nosy_names = ['gvanrossum', 'loewis', 'nnorwitz', 'arigo']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue595837'
versions = ['Python 2.3']

@nnorwitz
Copy link
Mannequin Author

nnorwitz mannequin commented Aug 16, 2002

This code is in copy_reg.py from 1997:

def pickle_complex(c):
    return complex, (c.real, c.imag)

pickle(type(1j), pickle_complex, complex)

I'm not sure if the function pickle_complex() is
necessary, but it definitely seems that the line after
should be commented out or removed. pickle_complex()
is not in the doc either.

(I was building WITHOUT_COMPLEX and found this problem.)

@nnorwitz nnorwitz mannequin closed this as completed Aug 16, 2002
@nnorwitz nnorwitz mannequin self-assigned this Aug 16, 2002
@nnorwitz nnorwitz mannequin added the stdlib Python modules in the Lib dir label Aug 16, 2002
@nnorwitz nnorwitz mannequin closed this as completed Aug 16, 2002
@nnorwitz nnorwitz mannequin self-assigned this Aug 16, 2002
@nnorwitz nnorwitz mannequin added the stdlib Python modules in the Lib dir label Aug 16, 2002
@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

Without that line you can't pickle complex numbers. Maybe it
should fail gracefully if complex doesn't exist. Feel free
to check in a fix for that.

@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

I'm rejecting this as invalid. Neal, if you disagree, just
reopen and assign to me.

@arigo
Copy link
Mannequin

arigo mannequin commented Jun 7, 2003

Logged In: YES
user_id=4771

proposed patch bpo-750595.

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 7, 2003

Logged In: YES
user_id=21627

I have committed the patch for 2.2 and 2.3, fixing this bug.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant