pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ipython/ipython/pull/15159

assets/global-0bd78641c0a1f3e0.css" /> chore: add 5 return type hints in completer.py by travellingsoldier85 · Pull Request #15159 · ipython/ipython · GitHub
Skip to content

chore: add 5 return type hints in completer.py#15159

Draft
travellingsoldier85 wants to merge 1 commit intoipython:mainfrom
travellingsoldier85:auto-improve/type_hint/209aa0-202603170902
Draft

chore: add 5 return type hints in completer.py#15159
travellingsoldier85 wants to merge 1 commit intoipython:mainfrom
travellingsoldier85:auto-improve/type_hint/209aa0-202603170902

Conversation

@travellingsoldier85
Copy link
Copy Markdown
Contributor

Summary

Added concrete return type annotations to functions in IPython/core/completer.py based on static analysis of return statements.

Changes

  • Add return type hint -> list to function
  • Add return type hint -> list to function
  • Add return type hint -> tuple to function
  • Add return type hint -> bool to function
  • Add return type hint -> list to function

Type of Change

  • Code quality improvement (type hints)
  • Bug fix
  • New feature

Motivation

These type annotations are inferred from actual return values in the function bodies (e.g. return True-> bool, return []-> list). They improve:

  • IDE autocompletion and type checking (mypy/pyright)
  • Code readability for contributors navigating the codebase
  • Bug prevention via static analysis

No functional changes — only type annotations added.

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Mar 19, 2026

In general don't stop to just list, or tuple, those are generics, and you can/should say they are list[str], list[tuple[str,...]]`, or whatever, try to be specific for the types it returns.

@Carreau Carreau force-pushed the auto-improve/type_hint/209aa0-202603170902 branch from 8ee873f to 6155c34 Compare March 19, 2026 10:31
@Carreau
Copy link
Copy Markdown
Member

Carreau commented Mar 19, 2026

https://typing.python.org/en/latest/reference/generics.html for introduction on generics.

@Carreau Carreau marked this pull request as draft March 25, 2026 15:03
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.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy