{"repo":"asottile/pyupgrade","free":true,"listed":false,"github":"https://github.com/asottile/pyupgrade","clone":"git clone https://github.com/asottile/pyupgrade.git","description":"A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.","language":"Python","stars":4113,"topics":["python","pre-commit","linter"],"license":"MIT","category":"dev-tools","readme_excerpt":"pyupgrade ========= A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language. Installation As a pre-commit hook See pre-commit for instructions Sample .pre-commit-config.yaml : Implemented features Set literals Dictionary comprehensions Replace unnecessary lambdas in collections.defaultdict calls Format Specifiers printf-style string formatting Availability: - Unless --keep-percent-format is passed. Unicode literals Invalid escape sequences is / is not comparison to constant literals In python3.8+, comparison to literals becomes a SyntaxWarning as the success of those comparisons is implementation specific (due to common object caching). .encode() to bytes literals extraneous parens in print(...) A fix for [python-modernize/python-modernize#178] [python-modernize/python-modernize#178]: https://github.com/python-modernize/python-modernize/issues/178 constant fold isinstance / issubclass / except unittest deprecated aliases Rewrites deprecated unittest method aliases to their non-deprecated forms. super() calls \"new style\" classes rewrites class declaration removes metaclass = type declaration forced str(\"native\") literals .encode(\"utf-8\") # coding: ... comment as of [PEP 3120], the default encoding for python source is UTF-8 [PEP 3120]: https://www.python.org/dev/peps/pep-3120/ future import removal Availability: - by default removes nested scopes , generators , with statement , absolute import , division , print function , unicode litera","default_branch":null,"files":null,"tree":[],"storefront":"/r/asottile","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/asottile/pyupgrade/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}