Skip to content

fix(docstring): retain doctest arrow prefix - #2085

Closed
aaron-ang wants to merge 1 commit into
facebook:mainfrom
aaron-ang:docstring-doctest
Closed

aaron-ang wants to merge 1 commit into
facebook:mainfrom
aaron-ang:docstring-doctest

Conversation

@aaron-ang

@aaron-ang aaron-ang commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #2086.

doctest prefix (>>> ) should be retained in Python docstring to preserve syntax highlighting.

Test Plan

@meta-cla meta-cla Bot added the cla signed label Jan 13, 2026
@aaron-ang
aaron-ang marked this pull request as draft January 13, 2026 01:27
@github-actions

Copy link
Copy Markdown

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

pandas (https://github.com/pandas-dev/pandas)
- ::error file=pandas/core/indexing.py,line=1470,col=9,endLine=1470,endColumn=28,title=Pyrefly bad-override::Class member `_LocIndexer._convert_to_indexer` overrides parent class `_LocationIndexer` in an inconsistent manner%0A  `_LocIndexer._convert_to_indexer` has type `BoundMethod[_LocIndexer, (self: _LocIndexer, key: Unknown, axis: int) -> ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | ndarray[tuple[Any, ...], dtype[Any]] | dict[str, int | integer[Any]] | dict[str, tuple[Unknown, ...]] | dict[str, Unknown] | Unknown]`, which is not assignable to `BoundMethod[_LocIndexer, (self: _LocIndexer, key: Unknown, axis: int) -> Never]`, the type of `_LocationIndexer._convert_to_indexer`
+ ::error file=pandas/core/indexing.py,line=1470,col=9,endLine=1470,endColumn=28,title=Pyrefly bad-override::Class member `_LocIndexer._convert_to_indexer` overrides parent class `_LocationIndexer` in an inconsistent manner%0A  `_LocIndexer._convert_to_indexer` has type `BoundMethod[_LocIndexer, (self: _LocIndexer, key: Unknown, axis: int) -> int | ndarray[tuple[int], dtype[Any]] | ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | ndarray[tuple[Any, ...], dtype[Any]] | slice[int, int, Any] | slice[Any, Any, Any] | dict[str, int | integer[Any]] | dict[str, tuple[Unknown, ...]] | dict[str, Unknown] | Unknown]`, which is not assignable to `BoundMethod[_LocIndexer, (self: _LocIndexer, key: Unknown, axis: int) -> Never]`, the type of `_LocationIndexer._convert_to_indexer`

@aaron-ang
aaron-ang marked this pull request as ready for review January 13, 2026 02:43

@stroxler stroxler left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the bug report and PR! Looks reasonable to me, I'll aim to get a second review and get it merged soon

@meta-codesync

meta-codesync Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@stroxler has imported this pull request. If you are a Meta employee, you can view this in D90594592.

@stroxler stroxler self-assigned this Jan 13, 2026

@grievejia grievejia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync

meta-codesync Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@stroxler merged this pull request in 6940e93.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completion removes doctest prefix and syntax highlighting

4 participants