Skip to content

When I use the Decorators to change the function's return , pylint doesn't recognize it #3954

Closed as not planned

Description

Steps to reproduce

class Hook:
    @classmethod
    def request_reflect(func):
        @wraps(func)
        def wrapss(*args, **kwargs):
            data = {"a":"b"}
        
            return data
        return wrapss


class Main(Hook):

    def void_main():
        a = 1
        b = 2
        return a, b

main = Main()

data = main.void_main()
assert data["a"] = "b"

Current behavior

When I use the hook function to change the return output ,Pylint will still throw an error in assert data["a"] = "b"
error is "Sequence index is not an int, slice, or instance with index"

Expected behavior

pylint --version output

pylint --2.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions