Message382792
**Feature**
A similar feature in typescript
```ts
const foo: number = 1
type Foo = typeof foo // type Foo = number
function bar(x: string): void {
}
type Bar = typeof bar // type Bar = (x: string) => void
```
**Pitch**
The expected way in future python.
```py
from typing import Type
foo: int = 1
Foo = Type[foo] # equivalent to Foo = int
def bar(x: string) -> None :
...
Bar = Type[bar] # equivalent to Bar = Callable[[str], None]
``` |
|
Date |
User |
Action |
Args |
2020-12-09 13:39:46 | wlf100220 | set | recipients:
+ wlf100220 |
2020-12-09 13:39:46 | wlf100220 | set | messageid: <1607521186.12.0.817710588965.issue42610@roundup.psfhosted.org> |
2020-12-09 13:39:46 | wlf100220 | link | issue42610 messages |
2020-12-09 13:39:46 | wlf100220 | create | |
|