Skip to content

Object of type "None" is not subscriptable #4569

Open
@tekumara

Description

@tekumara

Describe your environment

sdk 1.32.1

What happened?

errors in vscode/pyright with

Object of type "None" is not subscriptablePylance[reportOptionalSubscript](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportOptionalSubscript)

Image

Steps to Reproduce

print(span.attributes["name"])

Expected Result

No type error because span.attributes can never be None.

Actual Result

Object of type "None" is not subscriptablePylance[reportOptionalSubscript](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportOptionalSubscript)

Additional context

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions