adaptive-learning / flocs-core

Components for intelligent learning of computer science
1 stars 0 forks source link

Extend a state contract to support iteration #55

Closed effa closed 7 years ago

effa commented 7 years ago

It seems necessary that state[EntityType] should implement full Mapping interface (using some Pyton mixin (maybe abc.collections.Mappings), it should be enough to implement __getitem__, __len__ and __iter__ or something like that. Concering Django, lazy iteration can be achieved using QuerySets.

At this point, we should also implement inheritable tests (StateContractTests) for checking that the state contract is satisfied.

Also consider a filter method. This should be also straightforward in both pure Python (returning a "list comprehensions iterator") and Django (filter method on queryset).

effa commented 7 years ago

Done