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
class example: | |
def __init__(self): | |
self.name = 'dummy example' | |
def bigNumber(self, number): | |
return number * 1000000000 | |
e = example() | |
e.name # 'dummy example' | |
e.bigNumber(5) # 5000000000 | |
print('{:_}'.format(e.bigNumber(5))) # 5_000_000_000 |
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
l # (1, 2, 3, 4) | |
k = (1, 2, 4, 3) | |
l == k # False | |
l.__eq__(k) # False |
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
class BetterAddition: | |
def __init__(self, arg): | |
assert arg | |
match arg: | |
case str(): self.strVal = arg | |
case int(): self.intVal = arg | |
case _: print('int or str only') | |
def __add__(self, other): | |
assert other |
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
# --------------------------------- For Gist --------------------------------- # | |
alias ,gpy="gist --type 'py' --copy --skip-empty --paste" | |
alias ,gtxt="gist --type 'txt' --copy --skip-empty --paste" |
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
l = (1, 2, 3, 4,) |
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
l.count(3) # 1 |
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
from inspect import getmembers | |
getmembers(l) |
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
[('__add__', <method-wrapper '__add__' of tuple object at 0x7ff121d20860>), | |
('__class__', tuple), | |
('__class_getitem__', <function tuple.__class_getitem__>), | |
('__contains__', | |
<method-wrapper '__contains__' of tuple object at 0x7ff121d20860>), | |
('__delattr__', | |
<method-wrapper '__delattr__' of tuple object at 0x7ff121d20860>), | |
('__dir__', <function tuple.__dir__()>), | |
('__doc__', | |
"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object."), |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
<command name="next track" code="spfyNext" description="Skip to the next track."> | |
<access-group identifier="com.spotify.playback"/> | |
<cocoa class="SPNextTrackScriptCommand"/> | |
</command> | |
<command name="previous track" code="spfyPrev" description="Skip to the previous track."> | |
<access-group identifier="com.spotify.playback"/> | |
<cocoa class="SPPreviousTrackScriptCommand"/> | |
</command> | |
<command name="playpause" code="spfyPlPs" description="Toggle play/pause."> | |
<access-group identifier="com.spotify.playback"/> |
NewerOlder