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-January/131681.html below:

[Python-Dev] PEP 461 updates

[Python-Dev] PEP 461 updatesEthan Furman ethan at stoneleaf.us
Thu Jan 16 08:52:20 CET 2014
On 01/15/2014 06:12 PM, Glenn Linderman wrote:
> On 1/15/2014 4:13 PM, Ethan Furman wrote:
>>
>>   - no value generated errors
> ...
>>
>> %c will insert a single byte, either from an int in range(256), or from
>> a bytes argument of length 1.
>
> what does
>
> x = 354
> b"%c" % x
>
> produce?  Seems that construct produces a value dependent error in both python 2 & 3 (although it takes a much bigger
> value to produce the error in python 3, with str %... with bytes %, the problem with be reached at 256, just like python 2).
>
> Is this an intended exception to the overriding principle?

Hmm, thanks for spotting that.  Yes, that would be a value error if anything over 255 is used, both currently in Py2, 
and for bytes in Py3.  As Carl suggested, a little more explanation is needed in the PEP.

--
~Ethan~
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