4 ms·
https://docs.python.org/dev/whatsnew/3.12.html https://docs.python.org/dev/whatsnew/3.12.html For a lot more info on removals
by wirrbel 4y ago
https://docs.python.org/dev/whatsnew/3.12.html https://docs.python.org/dev/whatsnew/3.12.html For a lot more info on removals
- eesmith 4y ago> Removed many old deprecated unittest features ... > You can use https://github.com/isidentical/teyit https://github.com/isidentical/teyit to automatically modernise your unit tests. I tried out teyit when it was a "Show HN" 10 months ago (at https://news.ycombinator.com/item?id=29948813 https://news.ycombinator.com/item?id=29948813 ). It not only pointed out places where I was using a deprecated alias, but also fixed a few places where I was using the API poorly (using "assertTrue(a binop b)" instead of "assertBinOp(a, b)". I recommend it.
- toyg 4y agoI can't comment on the quality of the tool, I just don't like this attitude of "just use this tool we don't support, hosted on some platform we don't control, which might disappear tomorrow". Back in the day, this tool would have been shipped (and supported) with stdlib, or at least be frozen somewhere "official".
- samus 4y agoThat tool is not a permanent addition to the list of dependencies, but for a single migration effort. As such, it is unnecessary to include it in the standard library.
- eesmith 4y agoIf you really go "back in the day", this sort of tool wouldn't exist at all, and you would be expected to do it manually, because there were no easy ways to modify the syntax in a space- and comment-preserving way. ;) That was developed for 2to3. Huh. I did not know this - in lib2to3, the "asserts" fixer handles this sort of conversion, so you have the ability already .. so long as you don't use new Python 3.10+ syntax that lib2to3 doesn't handle. See https://docs.python.org/3.7/library/2to3.html#2to3fixer-asserts https://docs.python.org/3.7/library/2to3.html#2to3fixer-asse... . I wonder if serhiy-storchaka (who committed that What's New entry) knows about lib2to3's "asserts" fixer. And if that might be a relevant addition or change to the documentation. Someone who cares about this might want to point it out.