You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,14 @@ This project implements a transpiler for creating [pyright](https://github.com/m
6
6
This is useful in a number of scenarios.
7
7
For example:
8
8
9
-
- Automatic generation of type-safe APIs between Node.js and Python services
10
9
- Safely use JSON objects created by TypeScript projects in Python
11
-
- A nice way to write complex Python types using TypeScript
10
+
- Automatic generation of type-safe APIs between Node.js and Python applications
11
+
- An easy way to write complex Python typings using TypeScript
12
12
13
13
## Example
14
14
15
15
### TypeScript
16
+
16
17
```ts
17
18
exporttypeFoo= {
18
19
type:"foo"
@@ -102,8 +103,8 @@ This will result in optional entries beeing transpiled as `NotRequired[Optional[
102
103
103
104
## Limitations
104
105
105
-
We currently do not support the following features:
106
+
The main focus of this project is transpiling type definitions for serializable data (e.g. JSON objects), and the following is not planned to be supported:
106
107
107
-
- Generics, as they cannot be fully supported by Python
108
-
- Function signatures, as we restrict ourselves top serializable data
109
-
- Values, as this is an extremely difficult problem and we currently only attempt to transpile types
108
+
- Generics, as TypeScript's type system is much more powerful than Python's
109
+
- Function signatures, as we restrict ourselves to serializable data
0 commit comments