[Python-Dev] Re: Story behind vars() vs .__dict__

2020年12月21日 04:34:56 -0800

Hello,
On 2020年12月22日 01:10:17 +1300
Greg Ewing <[email protected]> wrote:
> On 22/12/20 12:36 am, Paul Sokolovsky wrote:
> > Expected clarification on ".__dict__ breaking object
> > encapsulation": 
> 
> Encapsulation is not something that Python has ever been big
> on. There are plenty of places where implementation details are
> exposed, and we don't regard that as a problem.
That's still not the reason to e.g. make the value of the proverbial
LOAD_METHOD opcode be available via dict type attribute, like:
dict.LOAD_METHOD. Or for that matter, not the reason to provide
object's internal storage via object's attribute: obj.__dict__.
But the question was about (thru-the-time) relationship of vars()
vs .__dict__ ...
-- 
Best regards,
 Paul mailto:[email protected]
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/KI2M2GO4MD6G3GZWP6KP5XQRVHVGWP4I/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to