Created
February 14, 2011 20:41
-
-
Save luisuribe/826504 to your computer and use it in GitHub Desktop.
git gist
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
// Clone just one branch | |
mkdir $BRANCH | |
cd $BRANCH | |
git init | |
git remote add -t $BRANCH -f origin $REMOTE_REPO | |
git checkout $BRANCH | |
// Aliases and stuff | |
git config --global user.name "Luis Uribe" | |
git config --global user.email [email protected] | |
git config --global color.ui true | |
alias ga='git add' | |
alias gp='git push' | |
alias gl='git log' | |
alias gs='git status' | |
alias gd='git diff' | |
alias gdc='git diff --cached' | |
alias gm='git commit -m' | |
alias gma='git commit -am' | |
alias gb='git branch' | |
alias gc='git checkout' | |
alias gra='git remote add' | |
alias grr='git remote rm' | |
alias gpu='git pull' | |
alias gcl='git clone' |
from typing import Protocol
class LivingThing(Protocol):
def eat(self, food:str) -> None:
...
def move(self) -> None:
...
def produce(self)-> str:
...
def breathe(self)-> None:
...
def die(self)-> None:
...
creating a concrete class with implements the protocol
class Animal(LivingThing):
def eat(self, food: str) -> None:
print(f"Animal eats {food}")
def move(self) -> None:
print("Animal moves")
def produce(self) -> str:
return "Animal produces offspring"
def breathe(self) -> None:
print("Animal breathes")
def die(self) -> None:
print("Animal dies")
instantiate
dog:Animal = Animal()
dog.eat("meat")
dog.move()
print(dog.produce())
dog.breathe()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.welcome.ng-star-inserted {
display: hidden;
}
.start-dates {
display:none !important;
}
#date-and-time {
display:none !important;
}
.check {
display:none !important;
}