Skip to content

Commit a44beac

Browse files
committed
Rewrite docstring for HideInInspector
1 parent 16070b7 commit a44beac

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎pyunity/core.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,22 +361,23 @@ class HideInInspector(SavedAttribute):
361361
362362
Notes
363363
-----
364-
The class variable is replaced after the class is defined.
364+
The class variable is replaced only when instances are created.
365365
For example:
366366
367367
.. code-block:: python
368368
369369
class MyBehaviour(Behaviour):
370370
attr = HideInInspector(str)
371371
372-
Here, accessing ``MyBehaviour.attr`` would return ``None``, and
372+
If ``behaviour`` is an added component of type ``MyBehaviour``,
373+
accessing ``behaviour.attr`` would raise ``AttributeError``, and
373374
374375
.. code-block:: python
375376
376377
class MyBehaviour(Behaviour):
377378
attr = HideInInspector(str, "default string")
378379
379-
Here, accessing ``MyBehaviour.attr`` would return
380+
Here, accessing ``behaviour.attr`` would return
380381
``"default string"``.
381382
382383
"""
@@ -432,6 +433,7 @@ def __init__(self):
432433
self.selfref = HideInInspector(type)
433434

434435
def __call__(self, **kwargs):
436+
# To disambiguate between the two `self` parameters
435437
selfref = self.selfref
436438

437439
class _decorator:

0 commit comments

Comments
 (0)