]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Reformat Python code
authorJonathan Wakely <jwakely@redhat.com>
Thu, 28 Sep 2023 13:54:59 +0000 (14:54 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 13 Nov 2023 15:18:09 +0000 (15:18 +0000)
commit46c391cc7d8f67bd4903696edbe972d45a2deca7
tree48c06123565fc68d1b5a01aaa21ce7ac5e384a43
parent3e50aada51b4d33b8bc16d885aa3307322533507
libstdc++: Reformat Python code

Some of these changes were suggested by autopep8's --aggressive
option, others are for readability.

Break long lines by splitting strings across multiple lines, or
introducing local variables to hold results.

Use raw strings for regular expressions, so that backslashes don't need
to be escaped.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py: Break long lines. Use raw
strings for regular expressions. Add whitespace around
operators.
(is_member_of_namespace): Use isinstance to check type.
(is_specialization_of): Likewise. Adjust template_name
for versioned namespace instead of duplicating the re.match
call.
(StdExpAnyPrinter._string_types): New static method.
(StdExpAnyPrinter.to_string): Use _string_types.

(cherry picked from commit 6b5c3f9b8139d9eee358b354b35da0b757a0270d)
libstdc++-v3/python/libstdcxx/v6/printers.py