Repository navigation
New:
- Update one item deep inside nested containers, like Clojure's
update-inandassoc-in. The path is a sequence of steps — keys, indices, and attribute names, in any mix — so dicts, lists,envs, named tuples, frozen dataclasses andfrozendicts can all be walked through in one call.mogrify_in_with(func, path, container)andmogrify_in_to(value, path, container)update in-place, withmogrify's semantics: every mutable container along the path keeps its identity, and an immutable one is rebuilt and stored back into its parent.fupdate_in_with(target, path, func)andfupdate_in_to(target, path, value)are the functional variants, which never mutate their input and share everything off the path with it.
Fixed:
- A shallow copy of an
env—copy.copy, orfupdategiven anenv— now has bindings of its own. It used to share them with the original, so rebinding a name in the copy rebound it in the original too. namedlambda's docstring now says it names a lambda bound in an env-assignment orletbinding in either spelling,:=or<<. It listed only<<, right after a bullet where:=meant Python's own named expression, so a reader could conclude the walrus form is not named.- The REPL documentation now says that the client reads piped stdin, running each line in the session namespace — so a shell script can drive a live app with nobody at the keyboard. The docs described only the interactive session, which is the smaller half of what the client does.
- It also names the trap that makes an automated check necessary: the session echoes the value of an expression and a statement has none, so a pipe made only of assignments prints nothing and looks identical whether it ran or not. Have such a script
printsomething and check for it;python3 -m unpythonic.net.serveris a throwaway host to test the pipe against first.
- It also names the trap that makes an automated check necessary: the session echoes the value of an expression and a statement has none, so a pipe made only of assignments prints nothing and looks identical whether it ran or not. Have such a script