-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement missing python special methods. (#467)
- Loading branch information
1 parent
9857135
commit b00a7c9
Showing
21 changed files
with
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- mode: snippet -*- | ||
# name: __aenter__ | ||
# key: _aenter | ||
# group: Special methods | ||
# -- | ||
async def __aenter__(self): | ||
$0 | ||
return self |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __aexit__ | ||
# key: _aexit | ||
# group: Special methods | ||
# -- | ||
async def __aexit__(self, exc_type, exc_value, traceback): | ||
$0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __aiter__ | ||
# key: _aiter | ||
# group: Special methods | ||
# -- | ||
def __aiter__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __anext__ | ||
# key: _anext | ||
# group: Special methods | ||
# -- | ||
async def __anext__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __await__ | ||
# key: _await | ||
# group: Special methods | ||
# -- | ||
def __await__(self): | ||
$0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __bytes__ | ||
# key: _bytes | ||
# group: Special methods | ||
# -- | ||
def __bytes__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __ceil__ | ||
# key: _ceil | ||
# group: Special methods | ||
# -- | ||
def __ceil__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __class_getitem__ | ||
# key: _class_getitem | ||
# group: Special methods | ||
# -- | ||
def __class_getitem__(cls, key): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __dir__ | ||
# key: _dir | ||
# group: Special methods | ||
# -- | ||
def __dir__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __floor__ | ||
# key: _floor | ||
# group: Special methods | ||
# -- | ||
def __floor__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __format__ | ||
# key: _format | ||
# group: Special methods | ||
# -- | ||
def __format__(self, format_spec): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __imatmul__ | ||
# key: _imatmul | ||
# group: Special methods | ||
# -- | ||
def __imatmul__(self, other): | ||
return $0 |
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,8 @@ | ||
# -*- mode: snippet -*- | ||
# name: __init_subclass__ | ||
# key: _init_subclass | ||
# group: Special methods | ||
# -- | ||
def __init_subclass__(cls, /${1:, param}, **kwargs): | ||
super().__init_subclass__(**kwargs) | ||
$0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __length_hint__ | ||
# key: _length_hint | ||
# group: Special methods | ||
# -- | ||
def __length_hint__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __matmul__ | ||
# key: _matmul | ||
# group: Special methods | ||
# -- | ||
def __matmul__(self, other): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __missing__ | ||
# key: _missing | ||
# group: Special methods | ||
# -- | ||
def __missing__(self): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __prepare__ | ||
# key: _prepare | ||
# group: Special methods | ||
# -- | ||
def __prepare__(name, bases, **kwds): | ||
return ${0:\{\}} |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __rmatmul__ | ||
# key: _rmatmul | ||
# group: Special methods | ||
# -- | ||
def __rmatmul__(self, other): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __round__ | ||
# key: _round | ||
# group: Special methods | ||
# -- | ||
def __round__(self, ndigits=None): | ||
return $0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __set_name__ | ||
# key: _set_name | ||
# group: Special methods | ||
# -- | ||
def __set_name__(self, owner, name): | ||
$0 |
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,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __trunc__ | ||
# key: _trunc | ||
# group: Special methods | ||
# -- | ||
def __trunc__(self): | ||
return $0 |