hook for providing type of 'with' block variables; provide type for contextlib.closing

This commit is contained in:
Dmitry Jemerov
2012-08-14 19:05:09 +02:00
parent 20b193d0b6
commit 411951bad3
4 changed files with 49 additions and 20 deletions
@@ -28,4 +28,7 @@ public interface PyTypeProvider {
@Nullable
PyType getIterationType(PyClass iterable);
@Nullable
PyType getContextManagerVariableType(PyClass contextManager, PyExpression withExpression, TypeEvalContext context);
}
@@ -96,6 +96,12 @@ public class PyTypeProviderBase implements PyTypeProvider {
return null;
}
@Nullable
@Override
public PyType getContextManagerVariableType(PyClass contextManager, PyExpression withExpression, TypeEvalContext context) {
return null;
}
protected void registerSelfReturnType(String classQualifiedName, Collection<String> methods) {
registerReturnType(classQualifiedName, methods, mySelfTypeCallback);
}