PyFunction (boolean inherited, final @Nullable TypeEvalContext context) { NameFinder<PyFunction> proc; if (isNewStyleClass(context)) { proc = new NameFinder<>(notNullizeContext(context), PyNames.INIT, PyNames.NEW) { @Nullable @Override protected PyClass getContainingClass(@NotNull PyFunction element) { return element.getContainingClass(); } }; } else { proc = new NameFinder<>(notNullizeContext(context), PyNames.INIT); } visitMethods(proc, inherited, context); return proc.getResult(); }