O que explica aquelas variáveis com nome de uma letra só. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.Īnzrfcnprf ner bar ubaxvat terng vqrn - yrg'f qb zber bs gubfr!""" Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Gurer fubhyq or bar- naq cersrenoyl bayl bar -boivbhf jnl gb qb vg. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. Mas qual a magia de, ao importar o módulo, ele imprimir algo na tela? A mais simples possível! E aqui apresento o código fonte do módulo this, que se encontra no arquivo cpython/Lib/this.py no código fonte do Python, nesse caso, na tag v3.10.0b1:įcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Uma primeira ideia (não foi de primeira, é claro que errei) para decifrar isso é com: E do dicionário pode-se ver que é uma cifra, pois o Gur transforma-se em: The listing can be found by typing import this at the interactive prompt. três letras, três letras, duas letras, seis letras e uma vírgula, como no título do Zen. According to the Python glossary, which contains definitions of popular terms related to this programming language, the Zen of Python is a: Listing of Python design principles and philosophies that are helpful in understanding and using the language. Perceba que o this.s tem várias quebras de linha ( \n), e no começo duas ( \n\n). "Gur Mra bs Clguba, ol Gvz Crgref\n\nOrnhgvshy vf orggre guna htyl.\nRkcyvpvg vf orggre guna vzcyvpvg.\nFvzcyr vf orggre guna pbzcyrk.\nPbzcyrk vf orggre guna pbzcyvpngrq.\nSyng vf orggre guna arfgrq.\nFcnefr vf orggre guna qrafr.\nErnqnovyvgl pbhagf.\nFcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.\nNygubhtu cenpgvpnyvgl orngf chevgl.\nReebef fubhyq arire cnff fvyragyl.\nHayrff rkcyvpvgyl fvyraprq.\nVa gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.\nGurer fubhyq or bar- naq cersrenoyl bayl bar -boivbhf jnl gb qb vg.\nNygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.\nAbj vf orggre guna arire.\nNygubhtu arire vf bsgra orggre guna *evtug* abj.\nVs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.\nVs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.\nAnzrfcnprf ner bar ubaxvat terng vqrn - yrg'f qb zber bs gubfr!" Um pouquinho de introspecção resolve muita coisa: Mas como estava nessa vibe de curiosidade, pensei comigo: "como isso funciona, de onde vem esse texto"? Namespaces are one honking great idea - let's do more of those! If the implementation is easy to explain, it may be a good idea. If the implementation is hard to explain, it's a bad idea. There should be one- and preferably only one -obvious way to do it.Īlthough that way may not be obvious at first unless you're Dutch.Īlthough never is often better than *right* now. In the face of ambiguity, refuse the temptation to guess. Special cases aren't special enough to break the rules. Decifrando o Zen do Python Eis que buscando algum conjunto de dados dentro do Python, deparei-me com a verdade sobre o Zen do PythonĮu queria montar um arquivo CSV com dados interessantes de dentro do próprio Python, e fui fuçando algumas coisas, até que, por acaso, mandei um import this no console para ver se rolava criar um arquivo a partir do texto gerado por ele:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |