Skip to content

Commit a0862be

Browse files
HyukjinKwonogrisel
andauthored
Fix typos (#406)
Co-authored-by: Olivier Grisel <[email protected]>
1 parent 8a278a1 commit a0862be

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cloudpickle/cloudpickle.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def g():
8888
DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL
8989

9090
# Track the provenance of reconstructed dynamic classes to make it possible to
91-
# recontruct instances from the matching singleton class definition when
91+
# reconstruct instances from the matching singleton class definition when
9292
# appropriate and preserve the usual "isinstance" semantics of Python objects.
9393
_DYNAMIC_CLASS_TRACKER_BY_CLASS = weakref.WeakKeyDictionary()
9494
_DYNAMIC_CLASS_TRACKER_BY_ID = weakref.WeakValueDictionary()
@@ -239,7 +239,7 @@ def _extract_code_globals(co):
239239
out_names = {names[oparg] for _, oparg in _walk_global_ops(co)}
240240

241241
# Declaring a function inside another one using the "def ..."
242-
# syntax generates a constant code object corresonding to the one
242+
# syntax generates a constant code object corresponding to the one
243243
# of the nested function's As the nested function may itself need
244244
# global variables, we need to introspect its code, extract its
245245
# globals, (look for code object in it's co_consts attribute..) and
@@ -460,7 +460,7 @@ def _is_parametrized_type_hint(obj):
460460
is_typing = getattr(obj, '__origin__', None) is not None
461461

462462
# typing_extensions.Literal
463-
is_litteral = getattr(obj, '__values__', None) is not None
463+
is_literal = getattr(obj, '__values__', None) is not None
464464

465465
# typing_extensions.Final
466466
is_final = getattr(obj, '__type__', None) is not None
@@ -472,7 +472,7 @@ def _is_parametrized_type_hint(obj):
472472
getattr(obj, '__result__', None) is not None and
473473
getattr(obj, '__args__', None) is not None
474474
)
475-
return any((is_typing, is_litteral, is_final, is_union, is_tuple,
475+
return any((is_typing, is_literal, is_final, is_union, is_tuple,
476476
is_callable))
477477

478478
def _create_parametrized_type_hint(origin, args):
@@ -702,7 +702,7 @@ def _make_skel_func(code, cell_count, base_globals=None):
702702
"""
703703
# This function is deprecated and should be removed in cloudpickle 1.7
704704
warnings.warn(
705-
"A pickle file created using an old (<=1.4.1) version of cloudpicke "
705+
"A pickle file created using an old (<=1.4.1) version of cloudpickle "
706706
"is currently being loaded. This is not supported by cloudpickle and "
707707
"will break in cloudpickle 1.7", category=UserWarning
708708
)

cloudpickle/cloudpickle_fast.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
is only available for Python versions 3.8+, a lot of backward-compatibility
77
code is also removed.
88
9-
Note that the C Pickler sublassing API is CPython-specific. Therefore, some
9+
Note that the C Pickler subclassing API is CPython-specific. Therefore, some
1010
guards present in cloudpickle.py that were written to handle PyPy specificities
1111
are not present in cloudpickle_fast.py
1212
"""
@@ -180,7 +180,7 @@ def _class_getstate(obj):
180180
clsdict.pop('__weakref__', None)
181181

182182
if issubclass(type(obj), abc.ABCMeta):
183-
# If obj is an instance of an ABCMeta subclass, dont pickle the
183+
# If obj is an instance of an ABCMeta subclass, don't pickle the
184184
# cache/negative caches populated during isinstance/issubclass
185185
# checks, but pickle the list of registered subclasses of obj.
186186
clsdict.pop('_abc_cache', None)
@@ -426,7 +426,7 @@ def _dict_items_reduce(obj):
426426

427427

428428
def _function_setstate(obj, state):
429-
"""Update the state of a dynaamic function.
429+
"""Update the state of a dynamic function.
430430
431431
As __closure__ and __globals__ are readonly attributes of a function, we
432432
cannot rely on the native setstate routine of pickle.load_build, that calls
@@ -579,7 +579,7 @@ def dump(self, obj):
579579
# `dispatch` attribute. Earlier versions of the protocol 5 CloudPickler
580580
# used `CloudPickler.dispatch` as a class-level attribute storing all
581581
# reducers implemented by cloudpickle, but the attribute name was not a
582-
# great choice given the meaning of `Cloudpickler.dispatch` when
582+
# great choice given the meaning of `CloudPickler.dispatch` when
583583
# `CloudPickler` extends the pure-python pickler.
584584
dispatch = dispatch_table
585585

@@ -653,7 +653,7 @@ def reducer_override(self, obj):
653653
return self._function_reduce(obj)
654654
else:
655655
# fallback to save_global, including the Pickler's
656-
# distpatch_table
656+
# dispatch_table
657657
return NotImplemented
658658

659659
else:

0 commit comments

Comments
 (0)