News for hackers. Stuff that matters.
Re:What's New in Python 3.12 by woolion on Wednesday October 18, 2023 @05:38PM (#37935125)
The problem was underspecified, but I suggested that under the assumption that the value would be an Optional[dict]. If you have another falsy value, it means either Optional[Any] or something like Optional[Union[dict, list]] (I put list as an example, but you get the idea).

I would say the only reasonable choice is Optional[dict], in which case it should be sufficient, but Python being Python, it could be anything. And in these cases you need to handle all cases way more carefully.

There are no comments on this comment yet.