dbrattli / Expression

Pragmatic functional programming for Python inspired by F#
https://expression.readthedocs.io
MIT License
424 stars 31 forks source link

Fix match of generic type #12

Closed dbrattli closed 3 years ago

dbrattli commented 3 years ago

Without this fix, x below will show type as Type[List[int]] and not List[int]:

xs = [1, 2, 3]

with match(xs) as case:
    for x in case(List[int]):
        assert x == xs
codecov[bot] commented 3 years ago

Codecov Report

Merging #12 (4780c0b) into main (9059b74) will increase coverage by 0.00%. The diff coverage is 85.71%.

@@           Coverage Diff           @@
##             main      #12   +/-   ##
=======================================
  Coverage   80.28%   80.29%           
=======================================
  Files          37       37           
  Lines        2130     2136    +6     
=======================================
+ Hits         1710     1715    +5     
- Misses        420      421    +1     
Impacted Files Coverage Δ
expression/collections/seq.py 87.63% <66.66%> (-0.35%) :arrow_down:
expression/collections/frozenlist.py 76.82% <100.00%> (+0.30%) :arrow_up:
expression/core/match.py 97.26% <100.00%> (ø)