title: Python equivalent of Java's `tryLock` (idiomatic)?
body: <p>In Java <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/locks/Lock.html#tryLock%28long,%20java.util.concurrent.TimeUnit%29" rel="nofollow noreferrer">tryLock(long time, TimeUnit unit)</a> can be used as a non-blocking attempt to acquire the lock. How can the equivalent in python be achieved? (Pythonic | <a href="https://stackoverflow.com/questions/302459/what-is-a-programming-idiom">idiomatic</a> way is preferred!)</p>
  
  <p>Java tryLock:</p>
  
  <pre><code>ReentrantLock lock1 = new ReentrantLock()
  if (lock1.tryLock(13, TimeUnit.SECONDS)) { ... }
  </code></pre>
  
  <p>Python Lock:</p>
  
  <pre><code>import threading
  lock = Lock()
  lock.acquire() # how to lock.acquire(timeout = 13) ?
  </code></pre>