sort python functions and methods alphabetically
* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically
Start file
@decorator1
def bbbb(*args):
pass
# do nothing here
return
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
class MyAAABigClass(object):
""" MyBigClass """
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
def bbbb(*args):
pass
# do nothing here
return
class MyBBBBigClass(object):
""" MyBigClass """
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
def bbbb(*args):
pass
# do nothing here
return
End file
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
def bbbb(*args):
pass
# do nothing here
return
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
class MyAAABigClass(object):
""" MyBigClass """
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
def bbbb(*args):
pass
# do nothing here
return
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
class MyBBBBigClass(object):
""" MyBigClass """
def aaa(name=xxx, arg=yux):
pass
# do nothing here
return
@decorator1
def bbbb(*args):
pass
# do nothing here
return
@decorator1
@decorator2
def cccc(xpto, llxs):
pass
View Diff
2,3c2
< @decorator1
< def bbbb(*args):
---
> def aaa(name=xxx, arg=yux):
10c9,10
< def aaa(name=xxx, arg=yux):
---
> @decorator1
> def bbbb(*args):
26,30d25
< @decorator1
< @decorator2
< def cccc(xpto, llxs):
< pass
<
44,47d38
<
< class MyBBBBigClass(object):
< """ MyBigClass """
<
52a44,47
>
> class MyBBBBigClass(object):
> """ MyBigClass """
>
64a60,64
>
> @decorator1
> @decorator2
> def cccc(xpto, llxs):
> pass
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 13 remaining solutions by signing in and submitting your own entry
#14 foobarbazqux12345 / @foobarbazqux121 - Score: 26 - 01/04/21 @ 02:26
8dd7Gp26G5dd38Gp47G5ddGpZZ
0 comments
#15 Mrmclarrinson / @mrmclarrinson - Score: 26 - 12/13/22 @ 15:08
8dd7Gp26G5dd38Gp47G5ddGpZZ
0 comments