Skip to content

Commit

Permalink
More static names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 28, 2018
1 parent 45d5d81 commit 50e55c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/nti/externalization/_internalization.pxd
Expand Up @@ -33,6 +33,7 @@ cdef IFromUnicode
cdef IMimeObjectFactory
cdef IClassObjectFactory
cdef IExternalizedObjectFactoryFinder
cdef identity

# optimizations

Expand Down
11 changes: 6 additions & 5 deletions src/nti/externalization/internalization.py
Expand Up @@ -18,7 +18,8 @@


# stdlib imports
import collections
from collections import MutableSequence
from collections import MutableMapping
import inspect
import numbers
import sys
Expand Down Expand Up @@ -343,7 +344,7 @@ def _resolve_externals(object_io, updating_object, externalObject,
continue
externalObjectOid = externalObject[keyPath]
unwrap = False
if not isinstance(externalObjectOid, collections.MutableSequence):
if not isinstance(externalObjectOid, MutableSequence):
externalObjectOid = [externalObjectOid, ]
unwrap = True

Expand Down Expand Up @@ -557,7 +558,7 @@ def update_from_external_object(containedObject, externalObject,

# Sequences do not represent python types, they represent collections of
# python types
if isinstance(externalObject, collections.MutableSequence):
if isinstance(externalObject, MutableSequence):
tmp = []
for value in externalObject:
if pre_hook is not None:
Expand All @@ -568,7 +569,7 @@ def update_from_external_object(containedObject, externalObject,
# in-place?
return tmp

assert isinstance(externalObject, collections.MutableMapping)
assert isinstance(externalObject, MutableMapping)

# We have to save the list of keys, it's common that they get popped during the update
# process, and then we have no descriptions to send
Expand All @@ -581,7 +582,7 @@ def update_from_external_object(containedObject, externalObject,
if pre_hook is not None:
pre_hook(k, v)

if isinstance(v, collections.MutableSequence):
if isinstance(v, MutableSequence):
# Update the sequence in-place
# XXX: This is not actually updating it.
# We need to slice externalObject[k[:]]
Expand Down

0 comments on commit 50e55c3

Please sign in to comment.