On Wed, Dec 4, 2019 at 5:22 PM Kyle Stanley <aeros...@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 _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/3CEPZAFTMNSRWZ43GV5W3BKU6GJZEIVT/ Code of Conduct: http://python.org/psf/codeofconduct/