Skip to content

Commit

Permalink
Fix typos (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
kianmeng committed Oct 21, 2021
1 parent 95d2a4c commit 30991cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data-classes.rst
Expand Up @@ -138,7 +138,7 @@ Issues
- Use inheritance, metaclasses, or decorators? Implementation detail,
decide after we finalize our goals.

- Should we explicitely support "shared" mutable defaults? Like
- Should we explicitly support "shared" mutable defaults? Like
__init__(self, x=[]). I think so. That is, we shouldn't do
something like try to detect mutable defaults and implicitly copy
them.
Expand Down
6 changes: 3 additions & 3 deletions dataclasses.py
Expand Up @@ -257,7 +257,7 @@ def __repr__(self):

# This is used to support the PEP 487 __set_name__ protocol in the
# case where we're using a field that contains a descriptor as a
# defaul value. For details on __set_name__, see
# default value. For details on __set_name__, see
# https://www.python.org/dev/peps/pep-0487/#implementation-details.
#
# Note that in _process_class, this Field object is overwritten
Expand Down Expand Up @@ -643,7 +643,7 @@ def _get_field(cls, a_name, a_type):
# In addition to checking for actual types here, also check for
# string annotations. get_type_hints() won't always work for us
# (see https://github.com/python/typing/issues/508 for example),
# plus it's expensive and would require an eval for every stirng
# plus it's expensive and would require an eval for every string
# annotation. So, make a best effort to see if this is a ClassVar
# or InitVar using regex's and checking that the thing referenced
# is actually of the correct type.
Expand Down Expand Up @@ -1116,7 +1116,7 @@ class C(Base):
raise TypeError(f'Invalid field: {item!r}')

if not isinstance(name, str) or not name.isidentifier():
raise TypeError(f'Field names must be valid identifers: {name!r}')
raise TypeError(f'Field names must be valid identifiers: {name!r}')
if keyword.iskeyword(name):
raise TypeError(f'Field names must not be keywords: {name!r}')
if name in seen:
Expand Down

0 comments on commit 30991cc

Please sign in to comment.