AI / Apache Burr Interview questions
What are the common State mutation methods in Burr?
Because State is immutable, every write goes through one of a small set of named operations, each returning a new State:
| Method | Effect |
state.update(foo=bar) | Sets key foo to bar. |
state.append(foo=bar) | Appends bar to the list stored at foo. |
state.increment(foo=1) | Increments the numeric value at foo by 1. |
state.wipe(keep=[...]) | Removes every key except the ones listed. |
state.wipe(delete=[...]) | Removes only the listed keys. |
Calling any of these without using the return value does nothing — state.update(foo=bar) on its own line is silently a no-op.
More Related questions...