I don't understand PEP 308.
Carl Bevil
carl_bevil at yahoo.com
Wed Mar 12 16:13:01 EST 2003
On Wed, 12 Mar 2003 17:39:07 +0000 Tetsuo <member16943 at dbforums.com> wrote:
>
> I saw there's a debate over it, and decided to read it. I didn't read
> much, but what I can understand is that it proposes an if-then
> statement.
>
> So how is it different from what's there already? You know...
>
> if a == abs(g):
> ....print "a = abs(" + str(g) + ")"
> else:
> ....print zlib.compress(str(locals())
>
> --
> Posted via http://dbforums.com
>
I'm guessing it will allow you to do things like you can in C:
in x;
bool b;
..
printf("The value of b is %s\n", b ? "true" : "false");
..
b = (x == 42) ? true : false;
.. that sort of thing. Now, whether or not this is "good coding style" is up
for debate, but I'm not gonna go there. :-)
Carl
More information about the Python-list
mailing list