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/2014-June/134796.html below:

[Python-Dev] Internal representation of strings and Micropython

[Python-Dev] Internal representation of strings and Micropython [Python-Dev] Internal representation of strings and MicropythonChris Angelico rosuav at gmail.com
Thu Jun 5 03:17:04 CEST 2014
On Thu, Jun 5, 2014 at 10:03 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> StringPositions could support the following operations:
>
>    StringPosition + int --> StringPosition
>    StringPosition - int --> StringPosition
>    StringPosition - StringPosition --> int
>
> These would be computed by counting characters forwards
> or backwards in the string, which would be slower than
> int arithmetic but still faster than counting from the
> beginning of the string every time.

The SP would have to keep track of which string it's associated with,
which might make for some surprising retentions of large strings.
(Imagine returning what you think is an integer, but actually turns
out to be a SP, and you're trying to work out why your program is
eating up so much more memory than it should. This int-like object is
so much more than an int.)

ChrisA
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