On Wed, Dec 4, 2019 at 5:22 PM Kyle Stanley <aeros167@gmail.com> wrote:
BTW, I think 2to3 can help to move from 2&3 code to 3-only code.
Instead, we can do:
* Don't recommend u-prefix except in Python 2&3 code. * Provide a tool to remove the u-prefix.
+1, this seems like the smoothest way of handling it and has very minimal impact on users. In 5+ years from now as u-strings become increasingly rare, we can consider a long term deprecation process. In the meantime, any tools we can provide to automate the process of converting them will make the transition that much easier.
The first one is already the case. PEP 414 reintroduced the u"..." literal form, specifically as a porting tool. Given that it has absolutely zero value in pure Py3 code, it can be assumed to be not recommended outside of 2/3 compatibility. I'm not sure how much value there'd be in a tool *just* to remove the u prefix, but perhaps a suite of 2to3-like fixers for "hey, now that you're dropping Python 2 support, here's some things you can take advantage of". For instance, "class Foo(object):" can become "class Foo:", and many uses of super() can become the zero-argument form. +1 on getting such a tool started. ChrisA