Expected Behavior
The universe selection parameter is a list and we can access the list semantics
def _fundamental_filter(self, fundamentals: List[Fundamental]) -> List[Symbol]:
f = fundamentals[0]
count = len(fundamentals)
Actual Behavior
The universe selection parameter is an iterator (IEnumerable).
def _fundamental_filter(self, fundamentals: Iterable[Fundamental]) -> List[Symbol]:
f = fundamentals[0] # syntax error
count = len(fundamentals) # syntax error
See QuantConnect/Documentation#2349
Potential Solution
We could fix the stubs to use Iterable instead of List, but I think converting IEnumerable to List is friendlier to users. The user can "fix" on his side using
def _fundamental_filter(self, fundamentals: List[Fundamental]) -> List[Symbol]:
fundamentals = list(fundamentals)
f = fundamentals[0]
count = len(fundamentals)
Checklist
Expected Behavior
The universe selection parameter is a list and we can access the list semantics
Actual Behavior
The universe selection parameter is an iterator (IEnumerable).
See QuantConnect/Documentation#2349
Potential Solution
We could fix the stubs to use
Iterableinstead ofList, but I think convertingIEnumerabletoListis friendlier to users. The user can "fix" on his side usingChecklist
masterbranch