Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types improvements #227

Closed
wants to merge 3 commits into from
Closed

Types improvements #227

wants to merge 3 commits into from

Conversation

Viicos
Copy link

@Viicos Viicos commented Aug 9, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a613867) to head (d848a50).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #227   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          507       507           
  Branches        96        96           
=========================================
  Hits           507       507           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hukkin
Copy link
Owner

hukkin commented Oct 2, 2024

Hey there!

I don't want to actively break Python 3.7 yet, or deviate from cpython/tomllib for little benefit, so closing this.

@hukkin hukkin closed this Oct 2, 2024
@Viicos
Copy link
Author

Viicos commented Oct 2, 2024

Hi @hukkin,

The minimum Python version is set in the metadata:

requires-python = ">=3.8"

Meaning the library can't possibly be installed on 3.7.

@Viicos
Copy link
Author

Viicos commented Oct 2, 2024

Regarding the deviation from the stdlib, understandable, I can also open a PR to cpython to parametrize the patterns?

@hukkin
Copy link
Owner

hukkin commented Oct 2, 2024

Meaning the library can't possibly be installed on 3.7.

Someone could theoretically package it for a distro despite the metadata, change the metadata themselves and test that 3.7 still works, or whatever. The main purpose of this repo currently is to be a backport of tomllib, so perhaps it makes sense to be extra conservative.

Regarding the deviation from the stdlib, understandable, I can also open a PR to cpython to parametrize the patterns?

I assume cpython may not appreciate such a PR since it doesn't run mypy against tomllib, the type annotations are there only because they were inherited from here. Might be best to avoid the busywork. Especially since they annotate private API, and are not incorrect, simply not as narrow as they could be.

@encukou
Copy link
Collaborator

encukou commented Oct 2, 2024

I assume cpython may not appreciate such a PR since it doesn't run mypy against tomllib

That is indeed the case, though it might change in the future. (It's not straightforward politically, but also technically since type-checkers ignore stdlib's annotations and use typeshed instead.)

@Viicos
Copy link
Author

Viicos commented Oct 2, 2024

That is indeed the case, though it might change in the future. (It's not straightforward politically, but also technically since type-checkers ignore stdlib's annotations and use typeshed instead.)

Was about to say that as well. pyright can't resolve the tomllib._re module, although it works through Pylance for some reason:

image

Anyway, happy to revisit in the future.

@Viicos Viicos deleted the types-improvements branch October 2, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants