zzzeek/sqlalchemy — pull request #137 by duesenfranz (2014-09-16 18:43:43+00:00)
Title: fix failing copy.deepcopy on CascadeOptions

While trying to create something like a *[Modelproxy][1]* - basically a metaclass that stores the bases, dict, and name of a class to create the sqlalchemy class on the fly, possibly for multiple different sessions, I've found that i need to [copy the dict of a class][2].
However, `copy.deepcopy` fails, and after digging around, I've found out that its because `CascadeOptions` inherits from `frozenset`, but expects different parameters: a `string` instead of a `list`.
I hoped to be able to simplify this ugly dict-copying code I have [there][2], and getting `copy.deepcopy` to work would be a promising start.
If you feel like I'm trying to achieve the wrong thing here - please feel free to tell me. :)

Anyhow, `copy.deepcopy` (and probably also things like `pickle`) failing could still be considered a bug, I think? If so, I would be happy if this pull request could be merged in!

[1]: https://github.com/wienerschnitzel/schnitzelserver/blob/b4551966e02833f34146fbda6993a51bbcada700/schnitzelserver/models/modelbase.py#L9
[2]: https://github.com/wienerschnitzel/schnitzelserver/blob/b4551966e02833f34146fbda6993a51bbcada700/schnitzelserver/models/modelbase.py#L52