test_directories = (lib_dir, lib_dir / "test")
run_always_files = {"test_grammar.py", "test_syntax.py", "test_compile.py",
"test_ast.py", "test_asdl_parser.py", "test_fstring.py",
- "test_patma.py"}
+ "test_patma.py", "test_type_alias.py", "test_type_params.py"}
_files_to_test = None
type_param = TypeVar(identifier name, expr? bound)
| ParamSpec(identifier name)
| TypeVarTuple(identifier name)
- attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
+ attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
}
if (!state->type_param_type) return 0;
if (!add_attributes(state, state->type_param_type, type_param_attributes,
4)) return 0;
- if (PyObject_SetAttr(state->type_param_type, state->end_lineno, Py_None) ==
- -1)
- return 0;
- if (PyObject_SetAttr(state->type_param_type, state->end_col_offset,
- Py_None) == -1)
- return 0;
state->TypeVar_type = make_type(state, "TypeVar", state->type_param_type,
TypeVar_fields, 2,
"TypeVar(identifier name, expr? bound)");
if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) {
return 1;
}
- if (tmp == NULL || tmp == Py_None) {
- Py_CLEAR(tmp);
- end_lineno = lineno;
+ if (tmp == NULL) {
+ PyErr_SetString(PyExc_TypeError, "required field \"end_lineno\" missing from type_param");
+ return 1;
}
else {
int res;
if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) {
return 1;
}
- if (tmp == NULL || tmp == Py_None) {
- Py_CLEAR(tmp);
- end_col_offset = col_offset;
+ if (tmp == NULL) {
+ PyErr_SetString(PyExc_TypeError, "required field \"end_col_offset\" missing from type_param");
+ return 1;
}
else {
int res;