Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

[Eric]
> I agree that there's no good way of telling if an
> arbitrary class is immutable, so I'm not sure we can 
> do anything here.

Consider using non-hashability as a proxy indicator for immutability.

    -  isinstance(f.default, (list, dict, set))
    +  f.default.__hash__ is None

While this is imperfect, it would be more reliable than what we have now.

----------
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to