-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create stubs for public methods of inherited internal classes (#69
) Closes #64 ### Summary of Changes Now stubs for public methods of internal classes that are being inherited will be created for the classes that inherit them. --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
- Loading branch information
1 parent
522f38d
commit 71b38d7
Showing
4 changed files
with
134 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class PublicSuperClass: | ||
def public_superclass_method(self) -> str: ... | ||
|
||
|
||
class PublicSubClass(PublicSuperClass): | ||
... | ||
|
||
|
||
class _PrivateInternalClass: | ||
class _PrivateInternalNestedClass: | ||
def public_internal_nested_class_method(self, a: None) -> bool: ... | ||
|
||
def public_internal_class_method(self, a: int) -> str: ... | ||
|
||
def _private_internal_class_method(self, b: list) -> None: ... | ||
|
||
|
||
class PublicSubClass2(_PrivateInternalClass): | ||
def public_subclass_method(self) -> str: ... | ||
|
||
|
||
class PublicSubClassFromNested(_PrivateInternalClass._PrivateInternalNestedClass): | ||
... | ||
|
||
|
||
class _TransitiveInternalClassA: | ||
def transitive_class_fun(self, c: list) -> list: ... | ||
|
||
|
||
class _TransitiveInternalClassB(_TransitiveInternalClassA): | ||
pass | ||
|
||
|
||
class InheritTransitively(_TransitiveInternalClassB): | ||
pass |
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
38 changes: 38 additions & 0 deletions
38
...test_generate_stubs/TestStubFileGeneration.test_stub_creation[inheritance_module].sdsstub
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,38 @@ | ||
@PythonModule("various_modules_package.inheritance_module") | ||
package variousModulesPackage.inheritanceModule | ||
|
||
class PublicSuperClass() { | ||
@Pure | ||
@PythonName("public_superclass_method") | ||
fun publicSuperclassMethod() -> result1: String | ||
} | ||
|
||
class PublicSubClass() sub PublicSuperClass | ||
|
||
class PublicSubClass2() { | ||
@Pure | ||
@PythonName("public_internal_class_method") | ||
fun publicInternalClassMethod( | ||
a: Int | ||
) -> result1: String | ||
|
||
@Pure | ||
@PythonName("public_subclass_method") | ||
fun publicSubclassMethod() -> result1: String | ||
} | ||
|
||
class PublicSubClassFromNested() { | ||
@Pure | ||
@PythonName("public_internal_nested_class_method") | ||
fun publicInternalNestedClassMethod( | ||
a: Nothing? | ||
) -> result1: Boolean | ||
} | ||
|
||
class InheritTransitively() { | ||
@Pure | ||
@PythonName("transitive_class_fun") | ||
fun transitiveClassFun( | ||
c: List<Any> | ||
) -> result1: List<Any> | ||
} |