mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
perf python: Fix MetricGroup return type in perf.pyi
The metrics() function can return a dictionary where the value is either
a string or a list of strings, so the type signature in the stub file
should be Union[str, List[str]].
Fixes: 430da3cd03b4 ("perf python: Add perf.pyi stubs file")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
b3d7c6c1a9
commit
b9514a9a13
|
|
@ -1,5 +1,5 @@
|
|||
"""Type stubs for the perf Python module."""
|
||||
from typing import Callable, Dict, List, Optional, Any, Iterator
|
||||
from typing import Callable, Dict, List, Optional, Any, Iterator, Union
|
||||
|
||||
def config_get(name: str) -> Optional[str]:
|
||||
"""Get a configuration value from perf config.
|
||||
|
|
@ -12,7 +12,7 @@ def config_get(name: str) -> Optional[str]:
|
|||
"""
|
||||
...
|
||||
|
||||
def metrics() -> List[Dict[str, str]]:
|
||||
def metrics() -> List[Dict[str, Union[str, List[str]]]]:
|
||||
"""Get a list of available metrics.
|
||||
|
||||
Returns:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user