-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update stub generation helper function to handle classes followe…
…d by dataclasses (#307) * fix: Updated the stub generation helper function to properly detect dataclasses that immediately follow a class that is having methods added to it via the extension mechanism
- Loading branch information
Showing
6 changed files
with
142 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import abc | ||
|
||
from abc import ABC | ||
|
||
from tm_devices.helpers import DeviceConfigEntry | ||
|
||
class PIDevice(ABC, metaclass=abc.ABCMeta): | ||
def __init__(self, config_entry: DeviceConfigEntry, verbose: bool) -> None: ... | ||
def already_exists(self) -> None: | ||
"""Return nothing.""" | ||
def added_method(self) -> None: | ||
"""Return nothing.""" | ||
|
||
class OtherDevice(ABC, metaclass=abc.ABCMeta): | ||
def __init__(self, config_entry: DeviceConfigEntry, verbose: bool) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import abc | ||
|
||
from abc import ABC | ||
from dataclasses import dataclass | ||
|
||
from tm_devices.helpers import DeviceConfigEntry | ||
|
||
class TSPDevice(ABC, metaclass=abc.ABCMeta): | ||
def __init__(self, config_entry: DeviceConfigEntry, verbose: bool) -> None: ... | ||
def already_exists(self) -> None: | ||
"""Return nothing.""" | ||
def added_tsp_method(self) -> None: | ||
"""Return nothing.""" | ||
|
||
@dataclass(frozen=True) | ||
class CustomDataclass: | ||
value1: str | ||
value2: int = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters