Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140113/faabcc2f/attachment.html below:
<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>(sorry for not piling on any existing threads - I don't subscribe to python-dev due to lack of time)<br><br></div>Brett Cannon asked me to chime in - I haven't actually read the very long thread at this point, I'm just providing responses to things Brett mentioned:<br>
<br></div>1) What do we need in terms of functionality<br><br></div>Best guess, %s, %d, and %f. I've not done a full audit of the code, but some limited looking over the grep hits for % in .py files suggests I'm right, and we could even do without %f (we only use that for 'hg --time' output, which we could do in unicode).<br>
<br></div>We also need some way to emit raw bytes (in potentially mixed encodings, yes I know this is "doing it wrong") to stdout/stderr (example: someone changes a file from latin1 to utf8, and then wants to see the resulting diff).<br>
<br></div>2) Would having it as an external library that worked with Python 2 help?<br><br>Probably, IF it came with 2.4 support (RHEL support, basically), and we could bundle it in our source tree. It's been extremely valuable to have the install only depend on a working C compiler and Python.<br>
<br></div>3) If this does go in, how long would it take us to port Mercurial to py3? Would it being in 3.5 hold us up?<br><br></div>I'm honestly not sure. I'm still in the outermost layers of this yak shave: fixing cyclic imports. I'll know more when I can at least get 'hg version' to print its own version, because at that point the testsuite failures might be informative. I'd honestly _rather_ this went into 3.5 *and* got lots of validation by both us and twisted (the other folks that care?) before becoming set in stone by a release. Does that make sense?<br>
<br></div>4) Do we care if it's .format()/%, or could it be in the stdlib?<br><br>It'd be really nice to not have to boil the oceans as far as editing everyplace in the codebase that does % today. If we do have to do that, it's not going to be much more helpful than something like:<br>
<br></div><div>def maybestr(a):<br></div><div>Â if isinstance(a, bytes):<br></div><div>Â Â Â return a.decode('latin1)<br></div><div>Â return a<br></div><div><br>def sprintf(fmt, *args):<br></div>Â (fmt.decode('latin1') % [maybestr(a) for a in args]).encode('latin1)<br>
<br></div>or similar. That was (roughly) what I was figuring I'd do today without any formal bytes-string-formatting support.<br><br><br></div>He also mentioned that some are calling for a shortened 3.5 release cycle - I'd rather not see that happen, for the aforementioned reason of wanting time to make sure this is Right - it'd be a shame to do the work and rush it out only to find something missing in an important way.<br>
<br></div>Feel free to ask further questions - I'll try to respond promptly.<br><br></div><div>AF<br></div><div><br></div>(For those curious: my hg-on-py3 repo isn't published at the moment because I rebuilt the server it lived on and I forgot to publish it. I'll rectify that sometime this week, I hope, but it's really totally nonfunctional due to cyclic imports.)<br>
</div>
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