diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index ffbe5d3980..3d4c6f4a5f 100644
--- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -343,8 +343,7 @@ FORMAT_MODULE_PATH = None
DATE_FORMAT = "N j, Y"
# Default formatting for datetime objects. See all available format strings
-# here:
-# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
+# here: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATETIME_FORMAT = "N j, Y, P"
# Default formatting for time objects. See all available format strings here:
@@ -362,8 +361,7 @@ YEAR_MONTH_FORMAT = "F Y"
MONTH_DAY_FORMAT = "F j"
# Default short formatting for date objects. See all available format strings
-# here:
-# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
+# here: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
SHORT_DATE_FORMAT = "m/d/Y"
# Default short formatting for datetime objects.
diff --git a/django/contrib/gis/geos/coordseq.py b/django/contrib/gis/geos/coordseq.py
index e54f3f2714..dec3495d25 100644
--- a/django/contrib/gis/geos/coordseq.py
+++ b/django/contrib/gis/geos/coordseq.py
@@ -181,8 +181,7 @@ class GEOSCoordSeq(GEOSBase):
def kml(self):
"Return the KML representation for the coordinates."
# Getting the substitution string depending on whether the coordinates
- # have
- # a Z dimension.
+ # have a Z dimension.
if self.hasz:
substr = "%s,%s,%s "
else:
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
index 99a4f2f94e..feb225cf8c 100644
--- a/django/contrib/gis/geos/libgeos.py
+++ b/django/contrib/gis/geos/libgeos.py
@@ -58,8 +58,7 @@ def load_geos():
# Getting the GEOS C library. The C interface (CDLL) is used for
# both *NIX and Windows.
# See the GEOS C API source code for more details on the library function
- # calls:
- # https://libgeos.org/doxygen/geos__c_8h_source.html
+ # calls: https://libgeos.org/doxygen/geos__c_8h_source.html
_lgeos = CDLL(lib_path)
# Here we set up the prototypes for the initGEOS_r and finishGEOS_r
# routines. These functions aren't actually called until they are
diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py
index 91ffe3acad..26a9dd3a3f 100644
--- a/django/contrib/humanize/templatetags/humanize.py
+++ b/django/contrib/humanize/templatetags/humanize.py
@@ -215,8 +215,8 @@ def naturaltime(value):
class NaturalTimeFormatter:
time_strings = {
- # Translators: delta will contain a string like '2 months' or '1 month,
- # 2 weeks'
+ # Translators: delta will contain a string like '2 months' or
+ # '1 month, 2 weeks'
"past-day": gettext_lazy("%(delta)s ago"),
# Translators: please keep a non-breaking space (U+00A0) between count
# and time unit.
@@ -248,8 +248,8 @@ class NaturalTimeFormatter:
"an hour from now", "%(count)s hours from now", "count",
),
# fmt: on
- # Translators: delta will contain a string like '2 months' or '1 month,
- # 2 weeks'
+ # Translators: delta will contain a string like '2 months' or
+ # '1 month, 2 weeks'
"future-day": gettext_lazy("%(delta)s from now"),
}
past_substrings = {
diff --git a/django/db/models/fields/tuple_lookups.py b/django/db/models/fields/tuple_lookups.py
index b861bbe9cc..e929c9bb89 100644
--- a/django/db/models/fields/tuple_lookups.py
+++ b/django/db/models/fields/tuple_lookups.py
@@ -370,8 +370,8 @@ class TupleIn(TupleLookupMixin, In):
return super(TupleLookupMixin, self).as_sql(compiler, connection)
# e.g.: (a, b, c) in [(x1, y1, z1), (x2, y2, z2)] as SQL:
- # WHERE (a = x1 AND b = y1 AND c = z1) OR (a = x2 AND b = y2 AND c =
- # z2)
+ # WHERE (a = x1 AND b = y1 AND c = z1)
+ # OR (a = x2 AND b = y2 AND c = z2)
root = WhereNode([], connector=OR)
lhs = self.lhs
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 3e3753ee5a..cc4d9c1f22 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -756,8 +756,8 @@ class QuerySet(AltersData):
save() on each of the instances, do not send any pre/post_save
signals, and do not set the primary key attribute if it is an
autoincrement field (except if
- features.can_return_rows_from_bulk_insert=True). Multi-table models are
- not supported.
+ features.can_return_rows_from_bulk_insert=True).
+ Multi-table models are not supported.
"""
# When you bulk insert you don't get the primary keys back (if it's an
# autoincrement, except if can_return_rows_from_bulk_insert=True), so
@@ -2561,7 +2561,7 @@ def prefetch_one_level(instances, prefetcher, lookup, level):
# of instances, and returns a tuple:
# (queryset of instances of self.model that are related to passed in
- # instances,
+ # instances,
# callable that gets value to be matched for returned instances,
# callable that gets value to be matched for passed in instances,
# boolean that is True for singly related objects,
diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py
index ffdd36c0c8..5314d37a1a 100644
--- a/django/db/models/sql/datastructures.py
+++ b/django/db/models/sql/datastructures.py
@@ -76,8 +76,8 @@ class Join:
def as_sql(self, compiler, connection):
"""
Generate the full
- LEFT OUTER JOIN sometable ON sometable.somecol =
- othertable.othercol, params
+ LEFT OUTER JOIN sometable
+ ON sometable.somecol = othertable.othercol, params
clause for this join.
"""
join_conditions = []
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 5e87f65e7c..dc019df166 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -2635,7 +2635,8 @@ class Query(BaseExpression):
Return a lookup usable for doing outerq.filter(lookup=self) and a
boolean indicating if the joins in the prefix contain a LEFT OUTER
- join. _"""
+ join.
+ """
all_paths = []
for _, paths in names_with_path:
all_paths.extend(paths)
diff --git a/django/dispatch/__init__.py b/django/dispatch/__init__.py
index bd219b4809..57295ae995 100644
--- a/django/dispatch/__init__.py
+++ b/django/dispatch/__init__.py
@@ -1,8 +1,8 @@
"""Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD)
-https://pypi.org/project/PyDispatcher/2.0.1/ See license.txt for original
-license.
+https://pypi.org/project/PyDispatcher/2.0.1/
+See license.txt for original license.
Heavily modified for Django's purposes.
"""
diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py
index eed321c690..120f2ac6de 100644
--- a/django/dispatch/dispatcher.py
+++ b/django/dispatch/dispatcher.py
@@ -29,8 +29,14 @@ class Signal:
Internal attributes:
receivers:
- [((id(receiver), id(sender)), ref(receiver), ref(sender),
- is_async)]
+ [
+ (
+ (id(receiver), id(sender)),
+ ref(receiver),
+ ref(sender),
+ is_async,
+ )
+ ]
sender_receivers_cache:
WeakKeyDictionary[sender, list[receiver]]
"""
diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
index f6b721c72a..97559fe286 100644
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -114,8 +114,8 @@ class BoundField(RenderableFieldMixin):
def as_text(self, attrs=None, **kwargs):
"""
- Return a string of HTML for representing this as an .
+ Return a string of HTML for representing this as an
+ .
"""
return self.as_widget(TextInput(), attrs, **kwargs)
@@ -125,8 +125,8 @@ class BoundField(RenderableFieldMixin):
def as_hidden(self, attrs=None, **kwargs):
"""
- Return a string of HTML for representing this as an .
+ Return a string of HTML for representing this as an
+ .
"""
return self.as_widget(self.field.hidden_widget(), attrs, **kwargs)
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 182d63c9b4..a5eee6831c 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -127,17 +127,16 @@ class Field:
# error_messages -- An optional dictionary to override the default
# messages that the field will raise.
# show_hidden_initial -- Boolean that specifies if it is needed to
- # render a
- # hidden widget with initial value after widget.
+ # render a hidden widget with initial value
+ # after widget.
# validators -- List of additional validators to use
# localize -- Boolean that specifies if the field should be localized.
# disabled -- Boolean that specifies whether the field is disabled,
- # that
- # is its widget is shown in the form but not editable.
+ # that is its widget is shown in the form but not editable.
# label_suffix -- Suffix to be added to the label. Overrides
# form's label_suffix.
# bound_field_class -- BoundField class to use in
- # Field.get_bound_field.
+ # Field.get_bound_field.
self.required, self.label, self.initial = required, label, initial
self.show_hidden_initial = show_hidden_initial
self.help_text = help_text
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 2bf3890941..8a57887f8d 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -2279,9 +2279,14 @@ class BaseEmailBackendTests(MailTestsMixin):
gettext_lazy("test@example.com"),
# RemovedInDjango70Warning: uncomment these cases when support for
# deprecated (name, address) tuples is removed.
- # [("nobody", "nobody@example.com"), ("other",
- # "other@example.com")], [["nobody", "nobody@example.com"],
- # ["other", "other@example.com"]],
+ # [
+ # ("nobody", "nobody@example.com"),
+ # ("other", "other@example.com")
+ # ],
+ # [
+ # ["nobody", "nobody@example.com"],
+ # ["other", "other@example.com"]
+ # ],
[("name", "test", "example.com")],
[("Name