A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079705.html below:

[Python-Dev] Slice as a copy... by design?

[Python-Dev] Slice as a copy... by design?Stefan Behnel stefan_ml at behnel.de
Thu May 22 20:39:06 CEST 2008
Isaac Morland wrote:
> On Thu, 22 May 2008, Christian Heimes wrote:
> 
>> The buffer interface was designed for the slice-as-copy use case:
>>
>>>>> a = "abcdefg"
>>>>> b = buffer(a, 2, 3)
>>>>> b
>> <read-only buffer for 0x839c2e0, size 3, offset 2 at 0x8391c40>
>>>>> str(b)
>> 'cde'
> [....]
> 
> This answers my musing about shared slices.  But it points me at another
> question: why is buffer() listed in "Non-essential Built-in Functions"?
> While it is obviously not essential like str() or list(), it isn't
> deprecated like apply().

Even worse, it's gone in Py3:

  Python 3.0a5 (r30a5:62856, May  9 2008, 11:26:14)
  [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> buffer
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  NameError: name 'buffer' is not defined

Stefan

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4