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

Change buffer/memoryview DeprecationWarning #47756

Closed
brettcannon opened this issue Aug 5, 2008 · 11 comments
Closed

Change buffer/memoryview DeprecationWarning #47756

brettcannon opened this issue Aug 5, 2008 · 11 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker

Comments

@brettcannon
Copy link
Member

BPO 3506
Nosy @gvanrossum, @brettcannon, @pitrou

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 = 'https://github.com/brettcannon'
closed_at = <Date 2008-08-08.04:17:44.600>
created_at = <Date 2008-08-05.18:48:10.666>
labels = ['interpreter-core', 'release-blocker']
title = 'Change buffer/memoryview DeprecationWarning'
updated_at = <Date 2008-08-08.04:17:44.598>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2008-08-08.04:17:44.598>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2008-08-08.04:17:44.600>
closer = 'brett.cannon'
components = ['Interpreter Core']
creation = <Date 2008-08-05.18:48:10.666>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 3506
keywords = []
message_count = 11.0
messages = ['70755', '70762', '70767', '70778', '70794', '70797', '70801', '70802', '70805', '70856', '70881']
nosy_count = 3.0
nosy_names = ['gvanrossum', 'brett.cannon', 'pitrou']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue3506'
versions = ['Python 2.6']

@brettcannon
Copy link
Member Author

Right now in 2.6, using buffer() warns that it is going away and to use
memoryview(). Unfortunately memoryview() won't be backported to 2.6 in
time for release.

That means the warning is covering something that is within 2to3's
realm. So the warning should be changed to more align with any specific
difference between buffer() and memoryview() (or bring buffer() back to
3.0).

@brettcannon brettcannon added release-blocker interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Aug 5, 2008
@gvanrossum
Copy link
Member

Definitely don't bring buffer() back in 3.0! It needs to die.

If 2to3 can do this reasonably well, let's do that.

@brettcannon
Copy link
Member Author

On Tue, Aug 5, 2008 at 12:41 PM, Guido van Rossum
<report@bugs.python.org> wrote:

Guido van Rossum <guido@python.org> added the comment:

Definitely don't bring buffer() back in 3.0! It needs to die.

If 2to3 can do this reasonably well, let's do that.

There is already a fixer to go from buffer() to memoryview(), but I
don't know how compatible the APIs are. That might still require a
warning.

@pitrou
Copy link
Member

pitrou commented Aug 6, 2008

The memoryview implementation is still unfinished (in py3k), so I
suggest we drop the warning or comment it out.

@brettcannon
Copy link
Member Author

How unfinished is it, Antoine? So much that it can't be used, or just to
the extent it doesn't take the same arguments as buffer()? If it is the
latter then the warning should be changed to warn about unsupported
arguments.

@pitrou
Copy link
Member

pitrou commented Aug 6, 2008

I'm no buffer API/memoryview expert, but at least slicing is not
implemented, and there are almost no unit tests. It can probably be
used, but given the absence of tests and of actual uses in the stdlib,
I'm not sure we can say it is robust and therefore promote it as
replacement.

Hopefully Travis will be able to enlighten us when he is back.

@brettcannon
Copy link
Member Author

On Wed, Aug 6, 2008 at 12:32 PM, Antoine Pitrou <report@bugs.python.org> wrote:

Antoine Pitrou <pitrou@free.fr> added the comment:

I'm no buffer API/memoryview expert, but at least slicing is not
implemented, and there are almost no unit tests. It can probably be
used, but given the absence of tests and of actual uses in the stdlib,
I'm not sure we can say it is robust and therefore promote it as
replacement.

Well, if it can't replace buffer() then the warning needs to change to
just flat-out state that buffer() is gone and not suggest any
replacement.

Hopefully Travis will be able to enlighten us when he is back.

Hopefully.

@gvanrossum
Copy link
Member

Well, if it can't replace buffer() then the warning needs to change to
just flat-out state that buffer() is gone and not suggest any
replacement.

+1. buffer() stinks. memoryview() rules. They don't hvae the same use
cases.

Is there truly nobody else who understands PEP-3118 well enough?

@brettcannon
Copy link
Member Author

On Wed, Aug 6, 2008 at 1:12 PM, Guido van Rossum <report@bugs.python.org> wrote:

Guido van Rossum <guido@python.org> added the comment:

> Well, if it can't replace buffer() then the warning needs to change to
> just flat-out state that buffer() is gone and not suggest any
> replacement.

+1. buffer() stinks. memoryview() rules. They don't hvae the same use
cases.

That settles that then.

Is there truly nobody else who understands PEP-3118 well enough?

Not me.

@brettcannon brettcannon self-assigned this Aug 6, 2008
@pitrou
Copy link
Member

pitrou commented Aug 7, 2008

Le mercredi 06 août 2008 à 20:12 +0000, Guido van Rossum a écrit :

+1. buffer() stinks. memoryview() rules. They don't hvae the same use
cases.

Is there truly nobody else who understands PEP-3118 well enough?

PEP-3118 is not very detailed (for example the exact semantics of
slicing are not specified: should it return a copy? I suppose not).
Also, most advanced uses of the buffer API seem related to numpy and
similar packages, which I've never used.

@brettcannon
Copy link
Member Author

In r65584 I changed the warning to not mention memoryview(); it just
says that buffer() does not exist in 3.0.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants