Supports set in addition to list/tuple in postgres ARRAY type

Issue #3436 wontfix
Adrian created an issue

In some cases it would be useful to have a set on the python side, e.g. because you don't need/want duplicates and the set api is nicer to use in that case (as you won't have to worry about removing dupes).

Since there's already as_tuple, I'd deprecate this option and have a python_type kwarg instead that defaults to list but can be set to tuple or set, too. as_tuple and python_type would be mutually exclusive.

Comments (2)

  1. Mike Bayer repo owner

    why dont you just use a TypeDecorator? can't think of a better case for it than a particular Python conversion of a standard type.

  2. Log in to comment