pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

lowercase typing_extensions.sentinel not handled right

Open bvolkmer opened this issue 4 months ago • 7 comments

Describe the Bug

typing_extensions introduced the lowercase variant of Sentinel as implemented in python 3.15 (related: #4059). Pyrefly currently (1.2.0-dev.2) handles uppercase and lowercase Sentinel differently:

from typing import reveal_type
from typing_extensions import Sentinel, sentinel

Lower = sentinel("Lower")
Upper = Sentinel("Upper")

reveal_type(Lower)
reveal_type(Upper)

Output with pyrefly 1.2.0-dev.2 on CPython 3.14.2:

 INFO revealed type: sentinel [reveal-type]
 --> test.py:7:12
  |
7 | reveal_type(Lower)
  |            -------
  |
 INFO revealed type: Upper [reveal-type]
 --> test.py:8:12
  |
8 | reveal_type(Upper)
  |            -------
  |
 INFO 0 errors

Output with pyrefly 1.2.0-dev.2 on CPython 3.15.0b3

 INFO revealed type: Lower [reveal-type]
 --> test.py:7:12
  |
7 | reveal_type(Lower)
  |            -------
  |
 INFO revealed type: Upper [reveal-type]
 --> test.py:8:12
  |
8 | reveal_type(Upper)
  |            -------
  |
 INFO 0 errors

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0AqADrow1ekxbsA%2BjHwMY6OBFxLO3XvwDKihqxhQANHTi79UOqjiMY00%2Bj3oDIkQBlcAdxiU6AXht2Zk5QABRCIO5elOEAlCIAqsTE3n50Og7mYSCJydEgcegilDAAbjCoUNKSMCGR3gXFZRVVzDU59SCGIGTFYFCkhAy0UBQAxHQACqS9-SYYOAR0AMaqkGwArpSoeqqEIuM6MHQAFgwMxHCIAPRXPTB9A7xsV4pXmLhLcFcrohAbWzt0Fc6GBeJYSqhoKhsLBlqs-pttip0HRcMRAXA9ugyAxjqoALRlSjKVSpcIAZkIAEYAEzhEQAbW81GJAF0ROt0FweHwYJh8ZgIMUlnoyqkAOR-dC8GDikTShj44oAR3WQr5%2BIA1jBSPjUEslvBrP5xR5UJR0HL0CAAL5dfWimAAMWgMAoaCweCIZFtQA

(Only applicable for extension issues) IDE Information

No response

bvolkmer avatar Jul 21 '26 08:07 bvolkmer

Probably just need to add it to special exports, I'll mark this as a "good first issue"

yangdanny97 avatar Jul 21 '26 12:07 yangdanny97

I'd like to give this a shot if it's unassigned.

MannXo avatar Jul 21 '26 14:07 MannXo

Hey @MannXo it is currently unassigned, but if you want to claim an unassigned issue in the future, feel free to use #claim without the quotes so it will be assigned to you. Feel free to try it out and assign yourself.

NathanTempest avatar Jul 22 '26 14:07 NathanTempest

@NathanTempest you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉

github-actions[bot] avatar Jul 22 '26 14:07 github-actions[bot]

@MannXo if you're not interested then I can pick this up

shubhamshettyy avatar Jul 22 '26 16:07 shubhamshettyy

#claim

MannXo avatar Jul 22 '26 16:07 MannXo

@MannXo you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉

github-actions[bot] avatar Jul 22 '26 16:07 github-actions[bot]