Skip to content

Instantly share code, notes, and snippets.

@grimborg
grimborg / typing_generic.py
Created Apr 19, 2020
Python Typing Generics
View typing_generic.py
from typing import TypeVar, Generic
from logging import Logger
T = TypeVar('T')
class LoggedVar(Generic[T]):
def __init__(self, value: T, name: str, logger: Logger) -> None:
self.name = name
self.logger = logger
self.value = value
View votes.py
#!/usr/bin/env python
# Requirements: requests, lxml
import requests
from lxml import html
TALKNAME = "TITLE OF MY AMAZING TALK (it's a secret!)"
COLOR = '\033[1;34m'
END = '\033[0m'
r = requests.get('http://2013.djangocon.eu/vote/')
You can’t perform that action at this time.