Skip to content

What should the type of super() be? #2956

@timabbott

Description

@timabbott

I found this new error that seems to have escaped a type: ignore when trying out the mypy 0.501:

zerver/storage.py:47: error: "super" has no attribute "post_process"

The code in question is https://github.com/zulip/zulip/blob/master/zerver/storage.py, the relevant block is the super_ret line below:

        super_class = super(AddHeaderMixin, self) # type: ignore # https://github.com/JukkaL/mypy/issues/857      
        if hasattr(super_class, 'post_process'):                                                                  
            super_ret = super_class.post_process(paths, dry_run, **kwargs)                                        
        else:                                                                                                     
            super_ret = []                                                                                        

I'll just add another type: ignore on the super_ret line for now, but I think it's a bug that mypy didn't suppress that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions