Skip to content

Commit

Permalink
Docstring fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv authored Dec 15, 2023
1 parent c46f1bd commit 28a6ea3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyiron_base/interfaces/lockable.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ class Lockable:
but we can unlock it as usual
>>> with d.unlocked() as dopen:
... dopen['b']['d'] = 23
>>> with d.unlocked():
... d['b']['d'] = 23
>>> d['b']['d']
23
Expand Down Expand Up @@ -342,6 +342,10 @@ def unlocked(self) -> _UnlockContext:
"""
Unlock the object temporarily.
Context manager returns this object again.
Context manager returns this object again and relocks it after the `with` statement finished.
.. note:: `lock()` vs. `unlocked()`
There is a small asymmetry between these two methods. :meth:`.lock` can only be done once (meaningfully), while :meth:`.unlocked` is a context manager and can be called multiple times.
"""
return _UnlockContext(self)

0 comments on commit 28a6ea3

Please sign in to comment.