Skip to content

Conversation

@fchapoton
Copy link
Contributor

so that mypy does not complain

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.

@github-actions
Copy link

Documentation preview for this PR (built with commit 487df77; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong
Copy link
Contributor

cxzhong commented Oct 21, 2025

Thanks

@user202729
Copy link
Contributor

user202729 commented Oct 22, 2025

the first reason of https://stackoverflow.com/a/73591412 makes more sense to me. I'm surprised | None is preferred even when it is meant to say "this argument can be omitted by the caller", but if that's the official Python policy, I can't complain too much.

Also, I think mypy has a "implicit optional" flag or something that might have been in effect when this code was written. Take a look at that, a simpler way might as well be to enable that flag by default.

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 26, 2025
sagemathgh-41092: tweak annotations for cachefunc
    
so that mypy does not complain

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#41092
Reported by: Frédéric Chapoton
Reviewer(s): Tobias Diez
@vbraun vbraun merged commit 23d371a into sagemath:develop Oct 27, 2025
25 checks passed
@fchapoton fchapoton deleted the typing_in_cachefunc branch November 3, 2025 16:37
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.

5 participants