Files
midas/tests/cases/python-parser/03_functions.py.ref.json
LordBaryhobal 4d343a61ff feat!: remove Python constraint type
this feature was only partially implemented (parsing) and the syntax was not ideal so this commit removes it entirely
2026-07-09 14:15:36 +02:00

127 lines
2.6 KiB
JSON

{
"stmts": [
{
"_type": "FromImportStmt",
"module": "__future__",
"imports": [
{
"_type": "ImportAlias",
"name": "annotations",
"alias": null
}
],
"level": 0
},
{
"_type": "Function",
"name": "func",
"params": {
"_type": "ParamSpec",
"pos": [],
"mixed": [
{
"name": "col1",
"type": {
"_type": "BaseType",
"base": "Column",
"args": [
{
"_type": "BaseType",
"base": "float",
"args": []
}
]
},
"default": null
},
{
"name": "col2",
"type": {
"_type": "BaseType",
"base": "Column",
"args": [
{
"_type": "BaseType",
"base": "float",
"args": []
}
]
},
"default": null
}
],
"kw": []
},
"returns": {
"_type": "BaseType",
"base": "Column",
"args": [
{
"_type": "BaseType",
"base": "float",
"args": []
}
]
},
"body": [
{
"_type": "ReturnStmt",
"value": {
"_type": "BinaryExpr",
"left": {
"_type": "VariableExpr",
"name": "col1"
},
"operator": "+",
"right": {
"_type": "VariableExpr",
"name": "col2"
}
}
}
]
},
{
"_type": "Function",
"name": "func2",
"params": {
"_type": "ParamSpec",
"pos": [
{
"name": "a",
"type": {
"_type": "BaseType",
"base": "int",
"args": []
},
"default": null
}
],
"mixed": [
{
"name": "b",
"type": {
"_type": "BaseType",
"base": "float",
"args": []
},
"default": null
}
],
"kw": [
{
"name": "c",
"type": {
"_type": "BaseType",
"base": "str",
"args": []
},
"default": null
}
]
},
"returns": null,
"body": []
}
]
}