3 ms·
Most everything good from Python 3 has been back-ported to 2.7. Except for built in parameterized tests in unittest. Python 3 has the subTest context manager
by jgalt212 10y ago
Most everything good from Python 3 has been back-ported to 2.7. Except for built in parameterized tests in unittest.
Python 3 has the subTest context manager (which looks great)
https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests https://docs.python.org/3/library/unittest.html#distinguishi...
In 2.7 you must use pytest, ddt, nose-paramemterized or dynamically add test methods to a TestCase class at runtime.
- scrollaway 10y agoMost everything good? Like high quality unicode support and async def?
- jgalt212 10y agoSome[1] have argued that unicode is better in 2.7 than 3.X. Async looks very useful, though, so I'll add that to the list including the subTest context manager. http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/ http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/
- Avernar 10y agoHigh quality unicode? Where every string with even a single emoji takes 4 times the memory. They should have used UTF-8 for their internal representation. Putting that aside, my issue with 3.X is that I have to use the unicode type even when I'm manipulating byte strings.
- scrollaway 10y ago> even when I'm manipulating byte strings What? No you don't. The `bytes` object is what you want when you deal with byte strings.
- Avernar 10y agoThe bytes object is not a string type. It's treated more like a list of integers. It has very little string operations. Only in 3.5 did they add back the ability to % format. Not to mention all the b prefixes it just becomes painful.