如何在映射列表中使用而不是逗号

How use instead of comma in mapped list

我的代码--

match key:
    case list(map(ord, map( str, range(1,10) )):
        #...

this map function makes this format-- [ord('1'), ord('2'), ord('3'), ...] from 1 to 9

但是想要[ord('1') | ord('2') | ...]

我该怎么做?

尝试:

match key:
    case key if key in map(ord, map( str, range(1,10))):
        #...

注意:代替双 map 使用理解:

>>> [ord(str(i)) for i in range(1, 10)]
[49, 50, 51, 52, 53, 54, 55, 56, 57]