python-frozendict icon indicating copy to clipboard operation
python-frozendict copied to clipboard

Generics?

Open bmccutchon opened this issue 6 years ago • 0 comments

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

def spam() -> FrozenDict[Text, int]):
  return frozendict({'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.

bmccutchon avatar Jun 19 '19 02:06 bmccutchon