Steven D'Aprano <st...@pearwood.info> added the comment:
I'm not sure what the implementation uses to enforce this, but decimal contexts already seem to reject arbitrary attributes. So a naive implementation that just setattr()'s the keyword arguments will automatically fail: >>> from decimal import getcontext >>> ctx = getcontext() >>> setattr(ctx, 'precision', 10) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'decimal.Context' object has no attribute 'precision' But you are absolutely correct that however we enforce it, we should avoid allowing typos to silently fail. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue47135> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com