Skip to content

Instantly share code, notes, and snippets.

View diogommartins's full-sized avatar
🚀

Diogo Magalhães Machado diogommartins

🚀
View GitHub Profile
@diogommartins
diogommartins / threads_start_stop.py
Last active May 29, 2018 23:29
Python thread start and stop
import threading
from time import sleep
def task():
thread = threading.current_thread()
i = 1
while True:
t_name = thread.getName()
print(f"{t_name} print {i}")
def soma(a, b):
return a + b
def soma(a: int, b: int) -> int:
return a + b
def soma(a: int, b: int) -> int:
return a + b
soma(6, 4)
soma(6, '6')
soma(6, 4) + 'Xablau'
def soma(a: int, b: int) -> str:
return a + b
x = 666
x = 'Xablau'
points = [(3, 3), (1, 3), (1, 6)]
points.append(('Xena', 'Mandioca'))
from typing import List, Tuple
points: List[Tuple[int, int]] = [(3, 3), (1, 3), (1, 6)]
points.append(('Xena', 'Mandioca'))
x: int = 666
x = 'Xablau'
x = 666
def soma(a, b):
return a + b
def a_func(a, b=42):
return a + b