pylink
pylink copied to clipboard
num_supported_devices in connect() adds test time
num_supported_devices() call inconnect adds > 100 ms test time each call. If we are not using lock/unlock can we add flag argument to skip?
https://github.com/square/pylink/blob/master/pylink/jlink.py#L933
I would rather not add a flag for this, but I think making _device
be a property on doing it when needed makes sense, and would produce the same result. E.g.
def connect(...):
<snipped>
self._chip_name = chip_name
def disconnect(...):
self._device = None
@property
def device(self):
if not self._device:
<do lookup>
self._device = instance
return self._device
If you want to go ahead and submit a patch, I'd be more than happy to merge it.