def get_peers(): _Peer._lock.acquire() peers = [copy.copy(peer.location) for peer in _Peer.peers.itervalues()] _Peer._lock.release() return peers