On Thu, Aug 27, 2020 at 2:14 PM Christopher Barker <pythonchb@gmail.com> wrote:
On Thu, Aug 27, 2020 at 11:01 AM Ricky Teachey <ricky@teachey.org> wrote:
What about something like this:

class Name(NamedTuple):
    first: str
    last: str

d = NamedKeyDict(Named)
d[first='david', last='mertz'] = 1_000_000  # dollars

right -- that would be a new custom class that took advantage of this feature.

Are you suggesting that the built in dict be extended to support this? I'm pretty sure Jonathan Fine did suggest that -- but I don't think that's a good idea myself.

-CHB

No not the built-in, but maybe as an addition to the collections module.

---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler