mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
This is a Path now
This commit is contained in:
@@ -15,6 +15,7 @@ the interesting information about all operations.
|
|||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from parso.tree import search_ancestor
|
from parso.tree import search_ancestor
|
||||||
@@ -92,11 +93,11 @@ class BaseName(object):
|
|||||||
return self._name.get_root_context()
|
return self._name.get_root_context()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def module_path(self) -> Optional[str]:
|
def module_path(self) -> Optional[Path]:
|
||||||
"""
|
"""
|
||||||
Shows the file path of a module. e.g. ``/usr/lib/python3.9/os.py``
|
Shows the file path of a module. e.g. ``/usr/lib/python3.9/os.py``
|
||||||
|
|
||||||
:rtype: str or None
|
:rtype: Path or None
|
||||||
"""
|
"""
|
||||||
module = self._get_module_context()
|
module = self._get_module_context()
|
||||||
if module.is_stub() or not module.is_compiled():
|
if module.is_stub() or not module.is_compiled():
|
||||||
|
|||||||
Reference in New Issue
Block a user