+2024-04-04 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Ignore 'use-dict-literal' warnings.
+ * pygnulib/.pylintrc: Don't emit warning messages suggesting that
+ 'dict()' be converted to '{}'. This literal can be mistaken for sets,
+ see discussion here:
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00054.html>
+ * pygnulib/main.py: Document this convention in coding style section.
+ * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Convert an
+ occurrence of '{}' to 'dict()'.
+
2024-04-04 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Fix pylint 'raise-missing-from' warnings.
# .pylintrc
[MESSAGES CONTROL]
-disable=C0103,C0114,C0121,C0123,C0209,C0301,C0302,R0902,R0912,R0913,R0914,R0915,R1705,R1702,R1720
+disable=C0103,C0114,C0121,C0123,C0209,C0301,C0302,R0902,R0912,R0913,R0914,R0915,R1705,R1702,R1720,R1735
# Local Variables:
# mode: conf
class GLFileAssistant:
'''GLFileAssistant is used to help with file processing.'''
- def __init__(self, config: GLConfig, transformers: dict[str, tuple[re.Pattern, str] | None] = {}) -> None:
+ def __init__(self, config: GLConfig, transformers: dict[str, tuple[re.Pattern, str] | None] = dict()) -> None:
'''Create GLFileAssistant instance.
config stores information shared between classes.
# - Prefer the standard collection type hints over those provided in the
# typing module. The latter are deprecated and may be removed.
# Cf. <https://peps.python.org/pep-0585/>.
+# - Never use the {} literal, because it denotes a dictionary,
+# as opposed to {x}, {x,y}, etc., which denote sets.
# You can use this command to check the style:
# $ pycodestyle *.py