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/2011-November/114626.html below:

[Python-Dev] file.readinto performance regression in Python 3.2 vs. 2.7?

[Python-Dev] file.readinto performance regression in Python 3.2 vs. 2.7? [Python-Dev] file.readinto performance regression in Python 3.2 vs. 2.7?Antoine Pitrou solipsis at pitrou.net
Fri Nov 25 02:07:00 CET 2011
On Fri, 25 Nov 2011 12:02:17 +1100
Matt Joiner <anacrolix at gmail.com> wrote:
> It's my impression that the readinto method does not fully support the
> buffer interface I was expecting. I've never had cause to use it until
> now. I've created a question on SO that describes my confusion:
> 
> http://stackoverflow.com/q/8263899/149482

Just use a memoryview and slice it:

b = bytearray(...)
m = memoryview(b)
n = f.readinto(m[some_offset:])

> Also I saw some comments on "top-posting" am I guilty of this?

Kind of :)

Regards

Antoine.


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