MCPcopy
hub / github.com/petertodd/python-bitcoinlib / __getattr__

Method __getattr__

bitcoin/rpc.py:321–335  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

319 **kwargs)
320
321 def __getattr__(self, name):
322 if name.startswith('__') and name.endswith('__'):
323 # Prevent RPC calls for non-existing python internal attribute
324 # access. If someone tries to get an internal attribute
325 # of RawProxy instance, and the instance does not have this
326 # attribute, we do not want the bogus RPC call to happen.
327 raise AttributeError
328
329 # Create a callable to do the actual call
330 f = lambda *args: self._call(name, *args)
331
332 # Make debuggers show <function bitcoin.rpc.name> rather than <function
333 # bitcoin.rpc.<lambda>>
334 f.__name__ = name
335 return f
336
337
338class Proxy(BaseProxy):

Callers

nothing calls this directly

Calls 1

_callMethod · 0.45

Tested by

no test coverage detected