You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -201,6 +201,8 @@ second usage. Save the result to a list if the result is needed multiple times.
201
201
202
202
**B038**: **Moved to B909** - Found a mutation of a mutable loop iterable inside the loop body. Changes to the iterable of a loop such as calls to `list.remove()` or via `del` can cause unintended bugs.
203
203
204
+
**B039**: ``ContextVar`` with mutable literal or function call as default. This is only evaluated once, and all subsequent calls to `.get()` would return the same instance of the default. This uses the same logic as B006 and B008, including ignoring values in ``extend-immutable-calls``.
205
+
204
206
Opinionated warnings
205
207
~~~~~~~~~~~~~~~~~~~~
206
208
@@ -315,7 +317,7 @@ The plugin currently has the following settings:
315
317
``extend-immutable-calls``: Specify a list of additional immutable calls.
316
318
This could be useful, when using other libraries that provide more immutable calls,
317
319
beside those already handled by ``flake8-bugbear``. Calls to these method will no longer
318
-
raise a ``B008`` warning.
320
+
raise a ``B008`` or ``B039`` warning.
319
321
320
322
``classmethod-decorators``: Specify a list of decorators to additionally mark a method as a ``classmethod`` as used by B902. The default only checks for ``classmethod``. When an ``@obj.name`` decorator is specified it will match against either ``name`` or ``obj.name``.
321
323
This functions similarly to how `pep8-naming <https://github.com/PyCQA/pep8-naming>` handles it, but with different defaults, and they don't support specifying attributes such that a decorator will never match against a specified value ``obj.name`` even if decorated with ``@obj.name``.
@@ -351,6 +353,11 @@ MIT
351
353
Change Log
352
354
----------
353
355
356
+
FUTURE
357
+
~~~~~~
358
+
359
+
* Add B039, ``ContextVar`` with mutable literal or function call as default.
0 commit comments