<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 29/11/2017 23:34, Chris Barker wrote:<br>
<blockquote type="cite"
cite="mid:CALGmxEJRes=J3LjdcVK8A40Os+Jh23yED9zrbsvNWh5R5Sfnrw@mail.gmail.com">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Nov 29, 2017 at 12:52 AM,
Serhiy Storchaka <span dir="ltr"><<a
href="mailto:storchaka@gmail.com" target="_blank"
moz-do-not-send="true">storchaka@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">This is a dict subclass
which allows to access items as attributes.<br>
<br>
d = plistlib.Dict()<br>
d['a'] = 1<br>
assert d.a == 1<br>
d.b = 2<br>
assert d['b'] == 2<br>
</blockquote>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">What do you think about
reviving this type as general purpose type in collections
or types</blockquote>
<div><br>
</div>
<div>Am I I the only one that thinks this is a "Bad Idea"?</div>
<div><br>
</div>
<div>For me, it simply confuses even more the question of
"is this code or is this data?" -- which is a difficult
enough design question in a dynamic language.</div>
<div><br>
</div>
<div>And the couple of libraries I"ve worked with that do
this I liked at first, but grew to find problematic.</div>
<div><br>
</div>
<br>
</div>
</div>
</div>
</blockquote>
I have also implemented something like this (as a convenience, to
hold a row from an SQL table). But it never occurred to me that
there should be something like it in the stdlib.<br>
Rob Cliffe<br>
</body>
</html>