interpretada. A sua filosofia é descrita no PEP20: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts.
list a = [1, 2, "apple", True] # dict a = {"name": "Carl", "languages": ["EN", "PT"]} # tuple a = ("apple", 1) # set a = {"orange", "apple", "strawberry"}
person.py class Person: def __init__(self, name, age): self.name = name self.age = age def hello(self): print("Hello, I am " + self.name) # main.py from person import Person p = Person("Carlos", 12) p.hello()
-> class FootballPlayer(Person): (Pdb) list 12 p.hello() 13 14 import pdb; pdb.set_trace() 15 16 # class inheritance 17 -> class FootballPlayer(Person): 18 def hello(self): 19 print("I am the football player " + self.name) 20 21 # class instance 22 f = FootballPlayer("Cristiano Ronaldo", 30) (Pdb)
do semantic versioning descritas em semver.org. O formato é MAJOR.MINOR.PATCH em que: • MAJOR - alterações incompatíveis com versões anteriores • MINOR - novas funcionalidades • PATCH - refactoring # version.py __version__ = "0.1.1"