Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSkovMadsen committed Nov 23, 2024
1 parent 0092617 commit 930ca17
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions param/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ def update(self_, arg=Undefined, /, **kwargs):
Examples
--------
Create a Parameterized class:
>>> import param
Expand All @@ -2400,25 +2400,26 @@ def update(self_, arg=Undefined, /, **kwargs):
>>> p = P(a="0. Hello", b="0. World")
Usea `.update` to update the parameters:
Use `.update` to update the parameters:
>>> p.param.update(a="1. Hello", b="2. World")
p.a, p.b
>>> p.a, p.b
('1. Hello', '1. World')
Update the parameters temporarily:
>>> with p.param.update(a="2. Hello", b="2. World"):
... p.a, p.b
2. Hello, 2. World
... print(p.a, p.b)
2. Hello 2. World
>>> p.a, p.b
1. Hello, 1. World
('1. Hello', '1. World')
Lets see that events are **after** all parameters have been updated
Lets see that events are triggered **after** all parameters have been updated
>>> @param.depends(p.param.a, watch=True)
... def print_a_b(a):
... print(p.a, p.b)
>>> my_param.param.update(a="3. Hello",b="3. World")
3. Hello 3. World
"""
Expand Down Expand Up @@ -4329,10 +4330,10 @@ class Parameterized(metaclass=ParameterizedMetaclass):
parameter in the instance will get the value given as a keyword
argument. For example:
class Foo(Parameterized):
xx = Parameter(default=1)
>>> class Foo(Parameterized):
... xx = Parameter(default=1)
foo = Foo(xx=20)
>>> foo = Foo(xx=20)
in this case foo.xx gets the value 20.
Expand Down

0 comments on commit 930ca17

Please sign in to comment.