spoqa / tsukkomi

(This project is abandoned. We recommend you to use typeguard instead.)
https://github.com/agronholm/typeguard
MIT License
10 stars 4 forks source link

Elements of container types are not typechecked #15

Open dahlia opened 8 years ago

dahlia commented 8 years ago

Although checking type of every element of every container type at runtime can make negative performance, users of this library expect these kinds of typechecks are done as well. If the problem is that its computation is O(n) I think we can sample only some elements to check types.

/cc @ipdae

ipdae commented 8 years ago
@typechecked
def test() -> typing.AbstractSet[uuid.UUID]:
    return {str(uuid.uuid4())}