Skip to content

3.1.0

Choose a tag to compare

@mattt mattt released this 09 Nov 23:57
6604242

Important

In Swift, the .object that namespace() returns now holds an internal marker instead of its attributes. This affects custom filters, custom functions, and direct calls to Globals.namespace. Encoding a namespace, or a value that contains one, with JSONEncoder now throws, and namespaces compare and hash by identity.

This release brings more templates in line with Jinja2, so some output changes:

  • Namespace attributes named like dict methods now read back as stored values, so namespace(items=[]) works and the LFM3-Omni chat template renders. Thanks to @JuanColilla for reporting this and for the first fix (#106).
  • Namespaces now raise errors for iteration, length, and tojson, as they do in Jinja2 (#106).
  • attribute= filters now look up items first (#106).
  • .title(), .lower(), and .upper() now follow Python's Unicode casing. For example, they're becomes They'Re, and a final sigma lowercases to ς (#104).
  • |list on a dict now returns its keys, |int converts booleans, and dicts and undefined values pass is sequence (#105).
  • in and == now compare integers and floats exactly, including integers above 2^53 (#105).

What's Changed

  • Match Python's Unicode casing in string methods by @mattt in #104
  • Match Jinja2's numeric, sequence, and filter behavior by @mattt in #105
  • Distinguish namespace attributes from dict methods by @mattt in #106

Full Changelog: 3.0.0...3.1.0