Something went wrong. Try again.
A fork of helix with a bespoke collection patches.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192import osfrom typing import ( List, Optional,)
class Example: attribute = 1
def __init__(self, first, second): self.first = first self.second = second self.values = [ 1, 2, 3, ] self.mapping = { "a": 1, "b": 2, }
def method(self, argument): if argument > 0: for index in range(argument): print(index) return argument elif argument < 0: while argument < 0: argument += 1 else: argument = 0
try: value = self.values[argument] except IndexError: value = None except (KeyError, ValueError): value = -1 else: value += 1 finally: print("done")
with open("file") as handle: data = handle.read()
return value
def aligned_call(): result = some_function(first_argument, second_argument, third_argument) return result
def hanging_call(): result = other_function( first_argument, second_argument, ) return result
def comprehensions(): squares = [ value * value for value in range(10) if value % 2 == 0 ] return squares
def match_example(command): match command: case "start": return 1 case "stop": return 0 case _: return -1
def docstring_example(): text = """first line indented in stringback""" return text