[Python-ideas] Input characters in strings by decimals (Was: Proposal for default character representation)

Mikhail V mikhailwas at gmail.com
Wed Dec 7 22:45:51 EST 2016


On 8 December 2016 at 03:32, Matthias welp <boekewurm at gmail.com> wrote:
> Dear Mikhail,
>
> With python3.6 you can use format strings to get very close to your
> desired behaviour:
>
>     f"{48:c}" == "0"
>     f"{<normal int literal here>:c}" == chr(<normal int literal here>)
>
> It works with variables too:
>
>     charvalue = 48
>     f"{charcvalue:c}" == chr(charvalue) # == "0"
>

Waaa! This works!

>
> I hope this helps solve your apparent usability problem.

Big big thanks, I didn't now this feature, but I have googled alot
about "input characters as decimals" , so it is just added?
Another evidence that Python rules!

I'll rewrite some code, hope it'll have no side issues.

Mikhail


More information about the Python-ideas mailing list