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-May/111498.html below:

[Python-Dev] Python 3.x and bytes

[Python-Dev] Python 3.x and bytes [Python-Dev] Python 3.x and bytesStefan Behnel stefan_ml at behnel.de
Thu May 19 10:37:03 CEST 2011
Xavier Morel, 19.05.2011 09:41:
> On 2011-05-19, at 07:28 , Georg Brandl wrote:
>> On 19.05.2011 00:39, Greg Ewing wrote:
>>> If someone sees that
>>>
>>>     some_var[3] == b'd'
>>>
>>> is true, and that
>>>
>>>     some_var[3] == 100
>>>
>>> is also true, they might expect to be able to do things
>>> like
>>>
>>>     n = b'd' + 1
>>>
>>> and get 101... or maybe b'e'...
>>
>> Maybe they should :)
>
> But why wouldn't "they" expect `b'de' + 1` to work as well in this case? If a 1-byte bytes is equivalent to an integer, why not an arbitrary one as well?

The result of this must obviously be b"de1".

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