-
Notifications
You must be signed in to change notification settings - Fork 476
Merge elpy snippets #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Merge elpy snippets #278
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ad0579d
elpy-initialize-variables: Add the Elpy snippet directory.
jorgenschaefer 09722d5
Small rework of the snippets.
jorgenschaefer 82bf3dd
Rework and expand the snippet collection.
jorgenschaefer 8a5dfb6
Add __bool__ snippet.
jorgenschaefer 4892b4a
updated yasnippet variable 'text' to 'yas-text'
dawuwgen de359b0
Return correct form of "super" depending on Python version
gopar 003ac43
Move yasnippet-snippets onto their own branch
sten0 00ebb08
PR #259 Change keys for __foo__ from "foo" to "_foo"
sten0 60ac7ec
Fix bug due to passage from elpy to yasnippet
galaunay 2bed97a
Merge branch 'elpy-snippets' into merge-elpy-snippets
sten0 d0a3280
Use snippet expansion for foo -> __foo__
sten0 11d78a9
Fix bug when specifying arguments on several lines
galaunay 6828266
Allow detection of Python 3 on PEP 394-compliant systems.
sten0 a302f02
Change elpy prefixes to yas-snips
sten0 7fc7274
Add newline at end of file for all files that were missing one.
sten0 9361eb5
Make python snippets able to handle arguments with type annotations.
galaunay 051f034
Use start-point from yas--apply-transform in snippet-init-assignment
sten0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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: __abs__ | ||
# key: _abs | ||
# group: Special methods | ||
# -- | ||
def __abs__(self): | ||
return $0 |
This file contains hidden or 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: __add__ | ||
# key: _add | ||
# group: Special methods | ||
# -- | ||
def __add__(self, other): | ||
return $0 |
This file contains hidden or 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: __and__ | ||
# key: _and | ||
# group: Special methods | ||
# -- | ||
def __and__(self, other): | ||
return $0 |
This file contains hidden or 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: __bool__ | ||
# key: _bool | ||
# group: Special methods | ||
# -- | ||
def __bool__(self): | ||
return $0 |
This file contains hidden or 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: __call__ | ||
# key: _call | ||
# group: Special methods | ||
# -- | ||
def __call__(self, ${1:*args}): | ||
return $0 |
This file contains hidden or 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: __cmp__ | ||
# key: _cmp | ||
# group: Special methods | ||
# -- | ||
def __cmp__(self, other): | ||
return $0 |
This file contains hidden or 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: __coerce__ | ||
# key: _coerce | ||
# group: Special methods | ||
# -- | ||
def __coerce__(self, other): | ||
return $0 |
This file contains hidden or 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: __complex__ | ||
# key: _complex | ||
# group: Special methods | ||
# -- | ||
def __complex__(self): | ||
return $0 |
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __contains__ | ||
# key: cont | ||
# group: dunder methods | ||
# key: _contains | ||
# group: Special methods | ||
# -- | ||
def __contains__(self, el): | ||
$0 | ||
def __contains__(self, item): | ||
return $0 |
This file contains hidden or 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: __del__ | ||
# key: _del | ||
# group: Special methods | ||
# -- | ||
def __del__(self): | ||
$0 |
This file contains hidden or 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: __delattr__ | ||
# key: _delattr | ||
# group: Special methods | ||
# -- | ||
def __delattr__(self, name): | ||
$0 |
This file contains hidden or 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: __delete__ | ||
# key: _delete | ||
# group: Special methods | ||
# -- | ||
def __delete__(self, instance): | ||
$0 |
This file contains hidden or 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: __delitem__ | ||
# key: _delitem | ||
# group: Special methods | ||
# -- | ||
def __delitem__(self, key): | ||
$0 |
This file contains hidden or 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: __div__ | ||
# key: _div | ||
# group: Special methods | ||
# -- | ||
def __div__(self, other): | ||
return $0 |
This file contains hidden or 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: __divmod__ | ||
# key: _divmod | ||
# group: Special methods | ||
# -- | ||
def __divmod__(self, other): | ||
return $0 |
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# -*- mode: snippet -*- | ||
# name: __enter__ | ||
# key: ent | ||
# group: dunder methods | ||
# key: _enter | ||
# group: Special methods | ||
# -- | ||
def __enter__(self): | ||
$0 | ||
|
||
return self | ||
return self |
This file contains hidden or 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: __eq__ | ||
# key: _eq | ||
# group: Special methods | ||
# -- | ||
def __eq__(self, other): | ||
return $0 |
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __exit__ | ||
# key: ex | ||
# group: dunder methods | ||
# key: _exit | ||
# group: Special methods | ||
# -- | ||
def __exit__(self, type, value, traceback): | ||
$0 | ||
def __exit__(self, exc_type, exc_value, traceback): | ||
$0 |
This file contains hidden or 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: __float__ | ||
# key: _float | ||
# group: Special methods | ||
# -- | ||
def __float__(self): | ||
return $0 |
This file contains hidden or 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: __floordiv__ | ||
# key: _floordiv | ||
# group: Special methods | ||
# -- | ||
def __floordiv__(self, other): | ||
return $0 |
This file contains hidden or 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: __ge__ | ||
# key: _ge | ||
# group: Special methods | ||
# -- | ||
def __ge__(self, other): | ||
return $0 |
This file contains hidden or 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: __get__ | ||
# key: _get | ||
# group: Special methods | ||
# -- | ||
def __get__(self, instance, owner): | ||
return $0 |
This file contains hidden or 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: __getattr__ | ||
# key: _getattr | ||
# group: Special methods | ||
# -- | ||
def __getattr__(self, name): | ||
return $0 |
This file contains hidden or 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: __getattribute__ | ||
# key: _getattr | ||
# group: Special methods | ||
# -- | ||
def __getattribute__(self, name): | ||
return $0 |
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: __getitem__ | ||
# key: getit | ||
# group: dunder methods | ||
# key: _getitem | ||
# group: Special methods | ||
# -- | ||
def __getitem__(self, ${1:key}): | ||
$0 | ||
def __getitem__(self, key): | ||
return $0 |
This file contains hidden or 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: __gt__ | ||
# key: _gt | ||
# group: Special methods | ||
# -- | ||
def __gt__(self, other): | ||
return $0 |
This file contains hidden or 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: __hash__ | ||
# key: _hash | ||
# group: Special methods | ||
# -- | ||
def __hash__(self): | ||
return $0 |
This file contains hidden or 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: __hex__ | ||
# key: _hex | ||
# group: Special methods | ||
# -- | ||
def __hex__(self): | ||
return $0 |
This file contains hidden or 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: __iadd__ | ||
# key: _iadd | ||
# group: Special methods | ||
# -- | ||
def __iadd__(self, other): | ||
return $0 |
This file contains hidden or 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: __iand__ | ||
# key: _iand | ||
# group: Special methods | ||
# -- | ||
def __iand__(self, other): | ||
return $0 |
This file contains hidden or 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: __idiv__ | ||
# key: _idiv | ||
# group: Special methods | ||
# -- | ||
def __idiv__(self, other): | ||
return $0 |
This file contains hidden or 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: __ifloordiv__ | ||
# key: _ifloordiv | ||
# group: Special methods | ||
# -- | ||
def __ifloordiv__(self, other): | ||
return $0 |
This file contains hidden or 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: __ilshift__ | ||
# key: _ilshift | ||
# group: Special methods | ||
# -- | ||
def __ilshift__(self, other): | ||
return $0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a mention of this removal in the commit messages. Is it an accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The silent removal is accidental. I seem to remember seeing this
add-hook
while ediffing, and thinking something like "that's bad style and should be done differently elsewhere", and so I think I must have pressedb
and let it get overwritten...which is arguably a mistake of laziness... IIRC it is possible to inheritpython-mode
's indentation style, which should already be'fixed
, without using a hook.