[issue27501] Add typing.py class describing a PEP 3118 buffer object

2020-05-19 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2020-05-19 Thread Jakub Stasiak


Change by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2019-11-26 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Cross-ref to the typing issue https://github.com/python/typing/issues/593. It 
looks like there is some interest in this feature.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2016-07-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Looking at the patch, I'm thinking that this endeavor isn't at all worthwhile.  
We don't need an ABC for everything especially if there in no pure python API 
involved.  I recommend closing this one until there is a proven need and a 
clear path forward.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2016-07-14 Thread Daniel Moisset

Daniel Moisset added the comment:

As a description of the idea I'm attaching a rough patch with an 
implementation. Some tests fail because of the following:

1) I didn't find a good place to register the Buffer ABC for mmap.mmap, and 
array.mmap; the modeules themselves are C extensions (and it's possible but 
weird to register the ABC from the C API); I could import those in typing.py 
but then I'd make typing depend from mmap and array which also feels wrong; so 
I didn't do that and the related tests that I added fail.

2) I had a similar situation with io.BytesIO. In that case there's a python 
module and I'm doing the abc.register there, but now io imports typing, and the 
test_site fails because many new modules (typing and its dependencies) are 
imported on startup. The alternative is to make typing depend on io (in this 
case it could be a reasonable idea)

After these, I'm feeling that typing.py may not be the best place for this (but 
given that collections.abc isn't either, I'm not sure where's the right place)

--
keywords: +patch
Added file: http://bugs.python.org/file43719/buffer.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2016-07-14 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2016-07-13 Thread Daniel Moisset

Daniel Moisset added the comment:

OK. Just to give an obvious example of a place where this would be useful for 
annotations is in the argument for the memoryview() builtin (currently declared 
with "# TODO arg can be any obj supporting the buffer protocol" in the standard 
library typesheds)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2016-07-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Since collections.abc is the wrong place, I'll change the title of this to 
typing and see if any of the typing aficionados think it is sufficiently useful 
(they are deliberately focusing on common use cases first since the whole 
static typing endeavor is exploratory and this limits of what should be done 
and what isn't really needed or useful isn't yet well understood).

--
title: Create a collections.abc class that describes PEP 3118 buffer -> Add 
typing.py class describing a PEP 3118 buffer object

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com