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


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

URL: http://github.com/ipython/ipython/commit/56c48006e88cfc82bb3e6cedc2056fea3aa3526a

Fix ruff and mypy issues in MonkeyType annotations · ipython/ipython@56c4800 · GitHub
Skip to content

Commit 56c4800

Browse files
claudeCarreau
authored andcommitted
Fix ruff and mypy issues in MonkeyType annotations
- ipstruct.py: remove duplicate `from typing import Any` (ruff F811) - skipdoctest.py: type skip_doctest param/return as Any since Callable doesn't allow arbitrary attribute assignment (__skip_doctest__) - path.py: fix get_xdg_dir return type str -> str | None (function returns None on non-posix or non-writable xdg dir) https://claude.ai/code/session_01L2i6WEqHEX3HyCMWgimmEp
1 parent 74904ca commit 56c4800

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

IPython/testing/skipdoctest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
numpy and sympy if they're present. Since this decorator is used in core parts
55
of IPython, it's in a separate module so that running IPython doesn't trigger
66
those imports."""
7-
from typing import Callable
7+
from typing import Any, Callable
88

99
# Copyright (C) IPython Development Team
1010
# Distributed under the terms of the Modified BSD License.
1111

1212

13-
def skip_doctest(f: Callable) -> Callable:
13+
def skip_doctest(f: Any) -> Any:
1414
"""Decorator - mark a function or method for skipping its doctest.
1515
1616
This decorator allows you to mark a function whose docstring you wish to

IPython/utils/ipstruct.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Brian Granger (refactoring to a dict subclass)
88
"""
99
from typing import Any
10-
from typing import Any
1110

1211
#-----------------------------------------------------------------------------
1312
# Copyright (C) 2008-2011 The IPython Development Team

IPython/utils/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def get_home_dir(require_writable: bool=False) -> str:
196196
raise HomeDirError('%s is not a writable dir, '
197197
'set $HOME environment variable to override' % homedir)
198198

199-
def get_xdg_dir() -> str:
199+
def get_xdg_dir() -> str | None:
200200
"""Return the XDG_CONFIG_HOME, if it is defined and exists, else None.
201201
202202
This is only for non-OS X posix (Linux,Unix,etc.) systems.

0 commit comments

Comments
 (0)
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