Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Minor functools.lru_cache in-code documentation issue #105172

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@bharel

Description

@bharel

Bug report

The in-code documentation for the lru_cache function states:

Iftyped is True, arguments of different types will be cached separately.
For example, f(3.0) and f(3) will be treated as distinct calls with
distinct results.

Specifically for 3.0 and 3, even if typed is False, they are still treated as distinct calls, asint is fast-tracked.

The online documentation states correctly:

(Some types such as str and int may be cached separately even when typed is false.)

I know the docstrings are seldom used, but if they already exists, at least they should be accurate as IDEs sometimes show them. Simply changing the example tof(3.0) andf(Decimal("3.0")) should suffice.

Your environment

  • CPython versions tested on: 3.13 (dev), applies to all supported CPython versions
  • Operating system and architecture: Mac OS Ventura

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp