-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(python): Scope staticmethods (
@staticmethod def
inside class
)
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 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
37 changes: 37 additions & 0 deletions
37
tests/langs/snapshots/r#mod__langs__base.py_staticmethods.snap
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,37 @@ | ||
--- | ||
source: tests/langs/mod.rs | ||
expression: inscope_parts | ||
--- | ||
- n: 52 | ||
l: " def static_decorator(func):\n" | ||
m: " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" | ||
- n: 53 | ||
l: " \"\"\"Decorator for static methods.\"\"\"\n" | ||
m: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
- n: 54 | ||
l: "\n" | ||
m: ^^ | ||
- n: 55 | ||
l: " def wrapper(*args, **kwargs):\n" | ||
m: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
- n: 56 | ||
l: " print(\"Static method decorator called\")\n" | ||
m: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
- n: 57 | ||
l: " return func(*args, **kwargs)\n" | ||
m: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
- n: 58 | ||
l: "\n" | ||
m: ^^ | ||
- n: 59 | ||
l: " return wrapper\n" | ||
m: "^^^^^^^^^^^^^^^^^^^^^^ " | ||
- n: 76 | ||
l: " def static_method() -> None:\n" | ||
m: " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" | ||
- n: 77 | ||
l: " \"\"\"Static method.\"\"\"\n" | ||
m: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
- n: 78 | ||
l: " print(\"Inside static method\")\n" | ||
m: "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " |