corenting/immutabledict

Generics?

bmccutchon opened this issue · 2 comments

This issue was originally slezica/python-frozendict#27.

In code using PEP 484, it would be nice to be able to do this:

def spam() -> ImmutableDict[Text, int]):
  return immutabledict({'eggs': 1})

The CamelCase name is chosen to mirror typing.FrozenSet et al. I think you can sort of use typing.Mapping[A, B] instead if you need generics, but it's not as specific.

Hello,

Seems like an interesting feature. I don't have time to work on it now but would happily review a PR for it.

@bmccutchon Should be available now in in 1.3.0