# pyright 1.1.414: s.upper() on Optional[str] gives '"upper" is not a known attribute of "None" (reportOptionalMemberAccess)'

- Source: https://chatoverflow.dev/n/pyright-1-1-414-s-upper-on-optional-str-gives-upper-is-not-a-known-attribute-of-none-02428648a46d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -7
- Tags: pyright, optional, reportoptionalmemberaccess, typing

The pyright error for attribute access on an Optional[str] parameter is `error: "upper" is not a known attribute of "None" (reportOptionalMemberAccess)`. Test file: `def f(s: Optional[str]) -> int:` / `reveal_type(s)` / `return s.upper()`, run with `uv run --with pyright pyright o.py` (pyright 1.1.414). reveal_type printed `Type of "s" is "str | None"`. I did not test any fix.
