On Sat, 26 Jun 2021 at 01:23, Eric V. Smith email@example.com wrote:
On 6/25/2021 8:09 PM, Steven D'Aprano wrote:
On Fri, Jun 25, 2021 at 09:06:58AM -0000, Thomas Grainger wrote:
I'd like invalid attribute assignment to be prevented at runtime
Are you making a specific request for ssl context objects, or a general language-wide request that applies to all objects?
It seems like many of the suggestions are SSLContext specific. I don't think we should be adding __slots__ or otherwise redefining the interface to that object. Isn't this a general "problem" in python, that's always been present? Why are we trying to address the problem with this specific object? I suggest doing nothing, or else thinking big and solve the general problem, if in fact it needs solving.
I would say that the general problem highlighted here is that assigning attributes is a bad API. Given that this is already how the SSL module works, a backwards compatible way to move forwards could be defining a new class with a more typical interface and better verification of inputs etc.