Skip to content

Commit dfc3ee5

Browse files
Update README.md
1 parent fd3d8e1 commit dfc3ee5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,30 +150,30 @@ pf = rational.partial_fractions(x)
150150
## 🔧 Advanced Features
151151
### Mutability Control
152152

153-
```python
153+
```python
154154
# Immutable (default)
155-
f = Expression("x^2")
156-
g = f + 1 # f unchanged, g is new Expression object
157-
155+
f = Expression("x^2")
156+
g = f + 1 # f unchanged, g is new Expression object
157+
158158
# Mutable Mode (f is modified in-place)
159-
f = Expression("x^2", mutable=True)
159+
f = Expression("(x-1)x^2", mutable=True)
160160
f += 1
161-
f.diff()
162-
```
161+
f.expand()
162+
```
163163

164164

165165
### Flexible String Parsing
166166

167-
```python
167+
```python
168168
# Natural mathematical notation
169-
expr = Expression("2x^2 + ln(|x-1|)")
169+
expr = Expression("2x^2 + ln(|x-1|)")
170170

171171
# LaTeX input support
172-
expr = Expression(r"\frac{x^2+1}{x-1}")
172+
expr = Expression(r"\frac{x^2+1}{x-1}")
173173

174-
# Implicit multiplication
174+
# Implicit multiplication
175175
expr = Expression("2x sin(x)")
176-
```
176+
```
177177

178178

179179
### Signal System for Reactive Programming
@@ -183,7 +183,8 @@ def on_change(expr): # runs whenever an operation changes f
183183
print(f"Expression changed to: {expr}")
184184
f = Expression("x^2")
185185
f.on_self_mutated.connect(on_change)
186-
f.on_self_cloned.connect(on_change)
186+
f.on_self_cloned.connect(on_change)
187+
f += 1 # on_change() is called
187188
```
188189

189190

0 commit comments

Comments
 (0)