Because there's no such thing as 1L anymore. There is one unified (unbounded) integer, and I believe the C implementation will use int to represent small values and long when necessary (and list of long beyond that?).
Are they going to abandon the 'Format %d:%s" % (n, s)' or just add PEP 3101? The % syntax is down-and-dirty practical good. PEP 3101 is neat, but printf() syntax is tough to beat.
I'm a little worried about this as well. I just wrote a ctemplate module that leverages % syntax a lot, so it would be quite unfortunate to see it disappear.
In other words, you could write code like:
char * months[%(len(pyvar_months))d];
My module uses string interpolation on this file, but it defines a special class with a __getitem__ method that instead of simply returning the associated string (as a dict would), it evaluates an arbitrary Python expression. And it works! It's pretty cool to be able to mix C and Python in this way to more easily write C code.That may seem minor, but I've used the same framework to be able to say:
%(array; char *; months; ['"%s"' % (mo,) for mo in pyvar_months])s
Assuming that pyvar_months is ["January", "February", "March", ..., "December"]
(in Python), the automatically-generated C result will be: /* header file */
extern char * months[12];
/* C file */
char * months[12] = {
"January",
"February",
"March",
...,
"December"
};
Okay, sorry to go so off topic, but I really wanted to show that it's possible to use the current string interpolation functionality to do really cool stuff, and it would be a shame to see that change.The ctemplate sounds really frickin' interesting. Is this an easy way to get a major performance boost on CPU-intensive bits of Python? Actually, this is probably getting off-topic, but will you email me when ctemplate is ready for prime-time?
By the way, you e-mail is not in your profile. You can send me an e-mail (in my profile), and I'd be happy to keep you posted.
Are they going to abandon the 'Format %d:%s" % (n, s)' or just add PEP 3101? The % syntax is down-and-dirty practical good. PEP 3101 is neat, but printf() syntax is tough to beat.
OK, the first screenful or so scared me. The rest looks like clear-cut improvements.
So far, I've loved Python's balance between simple purity and down-and-dirty pragmatism. I sure hope they don't shift too far toward purity.