pyright icon indicating copy to clipboard operation
pyright copied to clipboard

Incorrect `reportOperatorIssue` on `uuid.UUID().int`

Open lachesis opened this issue 8 months ago • 2 comments

Describe the bug pyright can't handle the .int attribute on uuid.UUID in the standard library

Code or Screenshots

import uuid
a = uuid.uuid4()
b = uuid.UUID(a.hex)

assert b.int - a.int == 0  # error: Operator "-" not supported for types "property" and "property" (reportOperatorIssue)

VS Code extension or command-line Command line tool. Python 3.14.3, pyright 1.1.407

lachesis avatar Mar 16 '26 21:03 lachesis

it looks like a duplicate of #10987, and 1.1.408 does not have the problem.

pinterior avatar Mar 19 '26 13:03 pinterior

Agreed, thank you! I didn't realize the Arch package was so out of date! https://archlinux.org/packages/extra/any/pyright/

lachesis avatar Mar 19 '26 17:03 lachesis