GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "lru_cache preserves signature of wrapped function (#6221)" by JukkaL · Pull Request #6356 · python/typeshed

Conversation

@JukkaL

@JukkaL JukkaL commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

This reverts commit 8bda66a.

The change causes issues with ParamSpec implementations in type
checkers, at least pyright and my work-in-progress support for
ParamSpec in mypy. It's not yet clear how to fix the issues, so I
think that it's best to revert this, at least temporarily until we've
found a good solution. See #6347 for context.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@JukkaL
Revert "lru_cache preserves signature of wrapped function (python#6221)"
4611613
This reverts commit 8bda66a.

The change causes issues with ParamSpec implementations in type
checkers, at least pyright and my work-in-progress support for
ParamSpec in mypy. It's not yet clear how to fix the issues, so I
think that it's best to revert this, at least temporarily until we've
found a good solution. See python#6347 for context.
@JukkaL JukkaL mentioned this pull request Nov 22, 2021
functools._lru_cache_wrapper should be a descriptor class, not a callable #6347
Closed
@github-actions

github-actions Bot commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

isort (https://github.com/pycqa/isort.git)
- isort/place.py:17: error: Returning Any from function declared to return "str"

pandas (https://github.com/pandas-dev/pandas.git)
- pandas/core/dtypes/cast.py:498: error: unused "type: ignore" comment

pydantic (https://github.com/samuelcolvin/pydantic.git)
- pydantic/tools.py:34: error: unused "type: ignore" comment

pytest (https://github.com/pytest-dev/pytest.git)
+ src/_pytest/config/__init__.py:1683: error: Argument 1 to "filterwarnings" has incompatible type "*Tuple[str, str, Type[Warning], str, int]"; expected "Union[Literal['default'], Literal['error'], Literal['ignore'], Literal['always'], Literal['module'], Literal['once']]"  [arg-type]
+ src/_pytest/config/__init__.py:1686: error: Argument 1 to "filterwarnings" has incompatible type "*Tuple[str, str, Type[Warning], str, int]"; expected "Union[Literal['default'], Literal['error'], Literal['ignore'], Literal['always'], Literal['module'], Literal['once']]"  [arg-type]
- src/_pytest/fixtures.py:1323: error: Unexpected keyword argument "params" for "FixtureFunctionMarker"  [call-arg]

aiohttp (https://github.com/aio-libs/aiohttp.git)
- aiohttp/multipart.py:518: error: Returning Any from function declared to return "str"  [no-any-return]
- aiohttp/multipart.py:692: error: Returning Any from function declared to return "str"  [no-any-return]
- aiohttp/connector.py:919: error: Returning Any from function declared to return "Optional[SSLContext]"  [no-any-return]
- aiohttp/connector.py:925: error: Returning Any from function declared to return "Optional[SSLContext]"  [no-any-return]
- aiohttp/connector.py:926: error: Returning Any from function declared to return "Optional[SSLContext]"  [no-any-return]
- aiohttp/client_reqrep.py:1010: error: Returning Any from function declared to return "str"  [no-any-return]

edgedb (https://github.com/edgedb/edgedb.git)
- edb/schema/objects.py:997: error: unused "type: ignore" comment
- edb/schema/objects.py:1992:9: error: Returning Any from function declared to return "QualName"
- edb/schema/objects.py:2223: error: unused "type: ignore" comment
- edb/schema/objects.py:2637:9: error: Returning Any from function declared to return "Name"
- edb/schema/schema.py:1146:9: error: Returning Any from function declared to return "FrozenSet[Cast]"
- edb/schema/schema.py:1156:9: error: Returning Any from function declared to return "FrozenSet[Cast]"
- edb/schema/schema.py:1166:9: error: Returning Any from function declared to return "FrozenSet[so.Object_T]"
- edb/schema/schema.py:1412:9: error: Returning Any from function declared to return "Optional[Migration]"
- edb/schema/scalars.py:132:9: error: Returning Any from function declared to return "bool"
- edb/schema/scalars.py:163:9: error: Returning Any from function declared to return "bool"
- edb/schema/scalars.py:176:9: error: Returning Any from function declared to return "int"
- edb/schema/casts.py:91:5: error: Returning Any from function declared to return "bool"
- edb/schema/casts.py:119:21: error: Returning Any from function declared to return "Optional[Type]"
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

srittau
srittau approved these changes Nov 22, 2021
View reviewed changes
@srittau
srittau merged commit a7798f6 into python:master Nov 22, 2021
@AlexWaygood AlexWaygood mentioned this pull request Jan 18, 2024
@functools.cache destroys the function signature #11280
Closed
@cdce8p cdce8p mentioned this pull request Mar 26, 2024
Use ParamSpec for lru_cache #11662
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@srittau srittau srittau approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JukkaL @srittau
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.