-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow subscripts to have methods called (#2735)
* Add subscripts to callable types * Add tests * Remove C backend
- Loading branch information
1 parent
3d74ccb
commit 44068ce
Showing
3 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
def test_attributes() -> None: | ||
a: i32 = 10 | ||
assert a.bit_length() == 4 | ||
|
||
b: str = 'abc' | ||
assert b.upper() == 'ABC' | ||
|
||
c: list[i32] = [10, 20, 30] | ||
assert c[0].bit_length() == 4 | ||
assert c.index(10) == 0 | ||
|
||
test_attributes() |
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