<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#330033" bgcolor="#ffffff">
On 5/17/2011 10:39 PM, Greg Ewing wrote:<br>
<blockquote cite="mid:4DD35B9C.3030702@canterbury.ac.nz" type="cite">Personally
I think that the default literal syntax for
<br>
bytes, and also the form produced by repr(), should have
<br>
been something more neutral, such as hex, with the ascii
<br>
form available for use when it makes sense.</blockquote>
<br>
<blockquote cite="mid:4DD35B9C.3030702@canterbury.ac.nz" type="cite">
Much nicer would be
<br>
<br>
some_var = x'deadbeef'
<br>
<br>
As for
<br>
<br>
<blockquote type="cite">--> some_other_var[3] == b'd'
<br>
</blockquote>
<br>
there ought to be a literal for specifying an integer
<br>
using an ascii character, so you could say something like
<br>
<br>
if some_other_var[3] == c'd':
<br>
<br>
which would be equivalent to
<br>
<br>
if some_other_var[3] == ord(b'd')
<br>
<br>
but without the overhead of computing the value each time
<br>
at run time.
<br>
</blockquote>
<br>
+1<br>
<br>
Seems this could be added compatibly?<br>
</body>
</html>