Skip to content

Commit

Permalink
Style, comment, and release cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
comrumino committed May 25, 2019
1 parent 7361490 commit 09eba86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
11 changes: 7 additions & 4 deletions rpyc/core/netref.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
])
_normalized_builtin_types = {}


def syncreq(proxy, handler, *args):
"""Performs a synchronous request on the given proxy object.
Not intended to be invoked directly.
Expand Down Expand Up @@ -117,8 +118,11 @@ class BaseNetref(with_metaclass(NetrefMetaclass, object)):
Do not use this class directly; use :func:`class_factory` instead.
:param conn: the :class:`rpyc.core.protocol.Connection` instance
:param id_pack: id tuple for an object such that (remote-obj-type-id, remote-obj-id)
(cont.) if remote-obj-type-id == remote-obj-id then object is a class. Otherwise, object is not a class
:param id_pack: id tuple for an object ~ (name_pack, remote-class-id, remote-instance-id)
(cont.) name_pack := __module__.__name__ (hits or misses on builtin cache and sys.module)
remote-class-id := id of object class (hits or misses on netref classes cache and instance checks)
remote-instance-id := id object instance (hits or misses on proxy cache)
id_pack is usually created by rpyc.lib.get_id_pack
"""
__slots__ = ["____conn__", "____id_pack__", "__weakref__", "____refcount__"]

Expand Down Expand Up @@ -217,7 +221,7 @@ def __reduce_ex__(self, proto):
def __instancecheck__(self, other):
# support for checking cached instances across connections
if isinstance(other, BaseNetref):
if self.____id_pack__[1] == self.____id_pack__[1]:
if self.____id_pack__[1] == self.____id_pack__[1]:
return True
else:
return syncreq(self, consts.HANDLE_INSTANCECHECK, other.____id_pack__)
Expand Down Expand Up @@ -298,7 +302,6 @@ def class_factory(id_pack, methods):
return type(name_pack, (BaseNetref,), ns)


#_normalized_builtin_types = {get_id_pack(_builtin): _builtin for _builtin in _builtin_types}
for _builtin in _builtin_types:
_id_pack = get_id_pack(_builtin)
_name_pack = _id_pack[0]
Expand Down
12 changes: 1 addition & 11 deletions rpyc/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,7 @@ def exp_backoff(collision):


def get_id_pack(obj):
"""introspects the given (local) object, returns id_pack as expected by BaseNetref
aliases,
cross-connection,
builtins,
sys-modules,
type or instance
# version compatibility without reload, b/c of ____oid__
"""
"""introspects the given (local) object, returns id_pack as expected by BaseNetref"""
if not inspect.isclass(obj):
name_pack = '{}.{}'.format(obj.__class__.__module__, obj.__class__.__name__)
return (name_pack, id(type(obj)), id(obj))
Expand All @@ -169,7 +160,6 @@ def get_id_pack(obj):
return (name_pack, id(obj), 0)



def get_methods(obj_attrs, obj):
"""introspects the given (local) object, returning a list of all of its
methods (going up the MRO).
Expand Down
2 changes: 1 addition & 1 deletion rpyc/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = (4, 0, 3)
version = (4, 1, 0)
version_string = ".".join(map(str, version))
release_date = "2019.05.25"

0 comments on commit 09eba86

Please sign in to comment.