Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cloudpickle/cloudpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def g():
DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL

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

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

# typing_extensions.Literal
is_litteral = getattr(obj, '__values__', None) is not None
is_literal = getattr(obj, '__values__', None) is not None

# typing_extensions.Final
is_final = getattr(obj, '__type__', None) is not None
Expand All @@ -472,7 +472,7 @@ def _is_parametrized_type_hint(obj):
getattr(obj, '__result__', None) is not None and
getattr(obj, '__args__', None) is not None
)
return any((is_typing, is_litteral, is_final, is_union, is_tuple,
return any((is_typing, is_literal, is_final, is_union, is_tuple,
is_callable))

def _create_parametrized_type_hint(origin, args):
Expand Down Expand Up @@ -702,7 +702,7 @@ def _make_skel_func(code, cell_count, base_globals=None):
"""
# This function is deprecated and should be removed in cloudpickle 1.7
warnings.warn(
"A pickle file created using an old (<=1.4.1) version of cloudpicke "
"A pickle file created using an old (<=1.4.1) version of cloudpickle "
"is currently being loaded. This is not supported by cloudpickle and "
"will break in cloudpickle 1.7", category=UserWarning
)
Expand Down
10 changes: 5 additions & 5 deletions cloudpickle/cloudpickle_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
is only available for Python versions 3.8+, a lot of backward-compatibility
code is also removed.

Note that the C Pickler sublassing API is CPython-specific. Therefore, some
Note that the C Pickler subclassing API is CPython-specific. Therefore, some
guards present in cloudpickle.py that were written to handle PyPy specificities
are not present in cloudpickle_fast.py
"""
Expand Down Expand Up @@ -180,7 +180,7 @@ def _class_getstate(obj):
clsdict.pop('__weakref__', None)

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


def _function_setstate(obj, state):
"""Update the state of a dynaamic function.
"""Update the state of a dynamic function.

As __closure__ and __globals__ are readonly attributes of a function, we
cannot rely on the native setstate routine of pickle.load_build, that calls
Expand Down Expand Up @@ -579,7 +579,7 @@ def dump(self, obj):
# `dispatch` attribute. Earlier versions of the protocol 5 CloudPickler
# used `CloudPickler.dispatch` as a class-level attribute storing all
# reducers implemented by cloudpickle, but the attribute name was not a
# great choice given the meaning of `Cloudpickler.dispatch` when
# great choice given the meaning of `CloudPickler.dispatch` when
# `CloudPickler` extends the pure-python pickler.
dispatch = dispatch_table

Expand Down Expand Up @@ -653,7 +653,7 @@ def reducer_override(self, obj):
return self._function_reduce(obj)
else:
# fallback to save_global, including the Pickler's
# distpatch_table
# dispatch_table
return NotImplemented

else:
Expand Down