diff -Nru a/protorpc/remote.py b/protorpc/remote.py --- a/protorpc/remote.py 2017-11-01 21:22:13.000000000 +0100 +++ b/protorpc/remote.py 2019-01-10 16:24:10.905549085 +0100 @@ -519,13 +519,13 @@ class _ServiceClass(type): """Meta-class for service class.""" - def __new_async_method(cls, remote): + def __new_asynchronous_method(cls, remote): """Create asynchronous method for Async handler. Args: remote: RemoteInfo to create method for. """ - def async_method(self, *args, **kwargs): + def asynchronous_method(self, *args, **kwargs): """Asynchronous remote method. Args: @@ -554,12 +554,12 @@ return self.transport.send_rpc(remote, request) - async_method.__name__ = remote.method.__name__ - async_method = util.positional(2)(async_method) - async_method.remote = remote - return async_method + asynchronous_method.__name__ = remote.method.__name__ + asynchronous_method = util.positional(2)(asynchronous_method) + asynchronous_method.remote = remote + return asynchronous_method - def __new_sync_method(cls, async_method): + def __new_sync_method(cls, asynchronous_method): """Create synchronous method for stub. Args: @@ -578,12 +578,12 @@ Returns: Response message from synchronized RPC. """ - return async_method(self.async, *args, **kwargs).response - sync_method.__name__ = async_method.__name__ - sync_method.remote = async_method.remote + return asynchronous_method(self.asynchronous, *args, **kwargs).response + sync_method.__name__ = asynchronous_method.__name__ + sync_method.remote = asynchronous_method.remote return sync_method - def __create_async_methods(cls, remote_methods): + def __create_asynchronous_methods(cls, remote_methods): """Construct a dictionary of asynchronous methods based on remote methods. Args: @@ -593,12 +593,12 @@ Dictionary of asynchronous methods with assocaited RemoteInfo objects. Results added to AsyncStub subclass. """ - async_methods = {} + asynchronous_methods = {} for method_name, method in remote_methods.items(): - async_methods[method_name] = cls.__new_async_method(method.remote) - return async_methods + asynchronous_methods[method_name] = cls.__new_asynchronous_method(method.remote) + return asynchronous_methods - def __create_sync_methods(cls, async_methods): + def __create_sync_methods(cls, asynchronous_methods): """Construct a dictionary of synchronous methods based on remote methods. Args: @@ -609,8 +609,8 @@ Results added to Stub subclass. """ sync_methods = {} - for method_name, async_method in async_methods.items(): - sync_methods[method_name] = cls.__new_sync_method(async_method) + for method_name, asynchronous_method in asynchronous_methods.items(): + sync_methods[method_name] = cls.__new_sync_method(asynchronous_method) return sync_methods def __new__(cls, name, bases, dct): @@ -672,10 +672,10 @@ # Build asynchronous stub class. stub_attributes = {'Service': cls} - async_methods = cls.__create_async_methods(cls.__remote_methods) - stub_attributes.update(async_methods) - async_class = type('AsyncStub', (StubBase, cls), stub_attributes) - cls.AsyncStub = async_class + asynchronous_methods = cls.__create_asynchronous_methods(cls.__remote_methods) + stub_attributes.update(asynchronous_methods) + asynchronous_class = type('AsyncStub', (StubBase, cls), stub_attributes) + cls.AsyncStub = asynchronous_class # Constructor for synchronous stub class. def __init__(self, transport): @@ -685,12 +685,12 @@ transport: Underlying transport to communicate with remote service. """ super(cls.Stub, self).__init__(transport) - self.async = cls.AsyncStub(transport) + self.asynchronous = cls.AsyncStub(transport) # Build synchronous stub class. stub_attributes = {'Service': cls, '__init__': __init__} - stub_attributes.update(cls.__create_sync_methods(async_methods)) + stub_attributes.update(cls.__create_sync_methods(asynchronous_methods)) cls.Stub = type('Stub', (StubBase, cls), stub_attributes) diff -Nru a/protorpc/remote_test.py b/protorpc/remote_test.py --- a/protorpc/remote_test.py 2017-11-01 21:22:13.000000000 +0100 +++ b/protorpc/remote_test.py 2019-01-10 16:25:44.824174841 +0100 @@ -638,7 +638,7 @@ self.mox.ReplayAll() - self.assertEquals(rpc, stub.async.remote_method(request)) + self.assertEquals(rpc, stub.asynchronous.remote_method(request)) self.mox.VerifyAll() @@ -657,7 +657,7 @@ self.mox.ReplayAll() - self.assertEquals(rpc, stub.async.remote_method(param1='val1', + self.assertEquals(rpc, stub.asynchronous.remote_method(param1='val1', param2='val2')) self.mox.VerifyAll() @@ -675,7 +675,7 @@ self.assertRaisesWithRegexpMatch( TypeError, r'May not provide both args and kwargs', - stub.async.remote_method, + stub.asynchronous.remote_method, request, param1='val1', param2='val2') @@ -695,7 +695,7 @@ self.assertRaisesWithRegexpMatch( TypeError, r'remote_method\(\) takes at most 2 positional arguments \(3 given\)', - stub.async.remote_method, + stub.asynchronous.remote_method, request, 'another value') self.mox.VerifyAll()