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
getattr(__builtins__,dir(list)[-(_:=((int()**int())+(int()**int())))**_][int()]+(f"{RecursionError!r}")[::-False**False][_]+zip.__doc__[int(_*(_+(int()**int()/_)))]+getattr(int,dir(int)[(~_)**_])[_//_]+breakpoint.__name__[(_+_//_)**_])(dir(__builtins__)[ord(dir(quit)[_**_+_][~_])-_//_][int()]+iter.__init__.__init__.__str__()[_**_**_+_*_+_//_]) |
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
(lambda _____,___=(getattr(__builtins__,dir(__builtins__)[ord(dir(__builtins__)[(_______:=(________:=__import__('math').e).__floor__() .__add__(________.__ceil__()))][_______.__add__(int().__pow__(int()))]).__sub__(_______.__floordiv__(_______))])(~(int().__pow__(int())))):[_:=[lambda _:[__:=lambda _,____=(___.__pow__(___).__add__(___.__floordiv__(___))):[___.__floordiv__(___),[__,lambda _,__:___.__sub__(___)][_____.__mod__(____).__eq__(___.__sub__(___))or(_____.__mod__(____.__add__(___)).__eq__(___.__sub__(___)))](_____,____.__add__(___).__add__(___.__pow__(___)))][____.__pow__(___).__le__(_____)],lambda _:___.__sub__(___)][_____.__mod__(___).__eq__(___.__sub__(___))or(_____.__mod__(___.__add__(___.__floordiv__(___))).__eq__(___.__sub__(___)))](_____),lambda ______:______.__gt__(___.__floordiv__(___))][_____.__le__(___.__add__(___.__floordiv__(___)))](_____),___.__floordiv__(___)][_==getattr(__builtins__,dir(__builtins__)[___.__pow__(___.__mul__(___).__add__(___.__floordiv__(___))).__add__(___.__mul__(___)._ |
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
lambda LАMBDA=0xa,*,LАMBDА=[[0o1]],LAMBDА=~bool(),LAMВDA=None:(LAMВDА:=lambda *LАMВDA:([lambda:LАMBDА,lambda:LAMВDА((LАMВDА:=LАMBDА.__getitem__(LAMBDА).__getitem__(LAMBDА).__sub__(LAMBDА)),(LАMBDА.append([*(getattr(__builtins__,dir(__builtins__).__getitem__(getattr(__builtins__,(str.__name__.__getitem__(LAMBDА.__sub__(LAMBDА))).__add__((__import__("slootcnuf".__getitem__(slice(LAMВDA,LAMВDA,LAMBDА)))._HashedSeq.__base__.__name__).__getitem__(slice(LAMВDA,(LAMBDА.__sub__(LAMBDА)).__sub__(LAMBDА.__add__(LAMBDА))))).__add__(ChildProcessError.__name__.__getitem__(slice(((LAMBDА.__add__(LAMBDА)).__pow__((LAMBDА.__sub__(LAMBDА)).__sub__(LAMBDА.__add__(LAMBDА)))).__mul__((LAMBDА.__sub__(LAMBDА)).__sub__(LAMBDА.__add__(LAMBDА))),((LAMBDА.__add__(LAMBDА)).__pow__((LAMBDА.__sub__(LAMBDА)).__sub__(LAMBDА.__add__(LAMBDА)))).__mul__((LAMBDА.__sub__(LAMBDА)).__sub__(LAMBDА.__add__(LAMBDА))).__sub__(LAMBDА.__add__(LAMBDА))))))(LAMВDA,LAMВDA,LAMBDА)).__getitem__((LAMBDА.__add__(LAMBDА)).__pow__(LAMBDА.__sub__(LAMBDА).__sub__ |
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
getattr(__builtins__,__file__.__getitem__((b:=(a:=(int().__pow__(int()))).__add__(a.__abs__()).__invert__()).__sub__(b).__add__(a.__invert__()))+getattr.__name__.__getitem__(int().__invert__())+__name__.strip(chr(b.__neg__().__pow__(-b).__mul__(b.__neg__()).__add__(b.__neg__().__mul__(b.__neg__())).__add__(b.__neg__()).__add__(b.__neg__()).__sub__(a))).__getitem__(b.__neg__().__sub__(a))+dir().__getitem__(float().__trunc__()).__getitem__(b.__neg__())+type.__class__.__class__.__class__.__class__.__class__.__class__.__class__.__class__.__name__.__getitem__(slice(None,a)))(object.__doc__[a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a]+license.__doc__[(a+a)**-b]+[*PermissionError.__doc__].pop(int()).lower()+str(__debug__)[~a]+type(complex()).__name__.__getitem__(~complex().real.__trunc__())) |
When a function never returns anything (i.e. returns None
), it doesn't require
an explicit return
at the end and early returns should be done without
providing any value:
# Correct
def greet(name: str) -> None:
print(f"Hello {name}!")
# Wrong
>>> try:
... int("")
... except ValueError:
... raise RuntimeError
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: ''
Based on the WordNet corpus, omitting results containing:
- slashes (e.g.
lo/ovral
) - spaces (e.g.
living_thing
) - digits (e.g.
1900s
)
Generated with the following Python script using NLTK:
from pathlib import Path
from nltk.corpus import wordnet
A collection of my best findings when looking through rejected Python Enhancement Proposals (as of Jan 6, 2024).
PEP 204: Range Literals
(2000, Python 2.0)
>>> [1:10]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> [:5]
[0, 1, 2, 3, 4]