
On Sun, Oct 31, 2021 at 5:25 PM Chris Angelico <rosuav@gmail.com> wrote:
I don't think this is a major problem. It's no worse than other things you can mess with, and if you do that sort of thing, you get only what you asked for; there's no way you can get a segfault or even an exception, as long as you use either None or a string.
(I should probably have some validation to make sure that those are the only two types in the tuple. Will jot that down as a TODO.)
Since __kwdefaults__ and __kwdefaults_extra__ are mutable dicts, there's not a lot of point trying to validate them on attribute assignment. Oh well. Would have been nicer to catch errors earlier. Not that it makes a huge difference. None is the most significant value here (it means "that's an early-bound default, even though it's Ellipsis"), and everything else currently just means "that's a late-bound default". ChrisA