Skip to content

PyGlove v0.4.4

Latest
Compare
Choose a tag to compare
@daiyip daiyip released this 04 Jan 19:14
· 35 commits to main since this release

This release contains refinements of object behaviors, including typing, formatting, serialization, hashing and etc. Besides, it introduces pg.io as an abstracted interface for operating with different file systems.

New Sub-packages

Enhancements

  • Typing

  • Object Formatting:

    • Introduce __str_format_args__ and __repr_format_args__ attributes for customize str/repr behavior for pg.Formattable. (7e0a98b)
    • Introduced pg.str_format and pg.repr_format context manager to control repr/str formatting for symbolic objects. (0a2ea6)
    • Add argument markdown for pg.str_format and pg.repr_format to quote the formatted object. (fd6ea8d)
    • Added argument use_inferred for pg.Symbolic formatting. (fdd3d3d)
    • Escape strings with ' and \n in pg.format. (0489642)
    • Better formatting for field docstr of multiple lines. (900d677)
  • Object Serialization:

    • Support module alias for deserialization. (536bde1)
    • Support use_inferred flag for pg.to_json and pg.save. (e223f6d)
  • Object Behaviors:

    • pg.List.__iter__ to honor inferrable values. (a4dacb5)
    • Enabled symbolic comparison/hashing on Python functions and methods. (occc11b)
    • Tune pg.Symbolic.set_accessor_writable behavior to only affect current node instead the entire sub-tree. (ee6009b)

Bug Fixes

  • pg.symbolic
    • Fix pg.Dict.sym_hash behavior for child symbolic objects whose use_symbolic_comparison is False. (58b60c3)
    • Fix the default value inspection for pg.Symbolic.sym_nondefaults and pg.format. (121b5ef)