forked from pythonclub/pythonclub.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.html
More file actions
194 lines (169 loc) · 15.5 KB
/
Copy pathfunction.html
File metadata and controls
194 lines (169 loc) · 15.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="PythonClub, ">
<meta name="theme-color" content="#101212">
<link rel="alternate" href="http://pythonclub.com.br/feeds/all.atom.xml" type="application/atom+xml" title="PythonClub Full Atom Feed"/>
<link rel="alternate" href="http://pythonclub.com.br/feeds/all.rss.xml" type="application/rss+xml" title="PythonClub Full RSS Feed"/>
<link rel="shortcut icon" href="http://pythonclub.com.br/theme/images/favicon.ico" >
<title>Tag function // PythonClub // </title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.3.0/pure-min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css">
<link rel="stylesheet" href="http://pythonclub.com.br/theme/css/pure.css">
<link rel="stylesheet" href="http://pythonclub.com.br/theme/css/custom.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-50935105-1', 'pythonclub.com.br');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
</script>
<!-- transifex -->
<!-- <script type="text/javascript"> -->
<!-- window.liveSettings = { -->
<!-- api_key: "f8fd260a9bdc4e9195c80e31416bb254", -->
<!-- picker: "bottom-right", -->
<!-- detectlang: true, -->
<!-- autocollect: true -->
<!-- }; -->
<!-- </script> -->
<!-- <script type="text/javascript" src="//cdn.transifex.com/live.js"></script> -->
<!-- end transifex -->
<meta name="google-site-verification" content="XQc_QtnTecI9nxAfplXGtECCpZQDwbDRcn7pyDVa1LE" />
</head>
<body>
<div class="pure-g-r" id="layout">
<div class="sidebar pure-u">
<div class="cover-img" style="background-image: url('')">
<div class="cover-body">
<header class="header">
<hgroup>
<h1 class="brand-main"><a href="/"><img src="http://res.cloudinary.com/diu8g9l0s/image/upload/v1400201393/pythonclub/logo_275x130.png" alt="PythonClub" /></a></h1>
<p class="tagline"></p>
<p class="links"><a href="http://pythonclub.com.br/archives.html">Arquivo</a></p>
<p class="links"><a href="http://pythonclub.com.br/pages/about.html">Quem Somos</a></p>
<div class="section articles-random">
<h1 class="tagline">Não deixe de ver!</h1>
<div id="random-articles"></div>
</div>
<p class="social">
<a href="https://github.com/pythonclub/pythonclub.github.io">
<i class="fa fa-github fa-3x"></i>
</a>
<a href="feeds/all.atom.xml">
<i class="fa fa-rss fa-3x"></i>
</a>
</p>
<p class="tagline">
Esta comunidade é signatária do
<a target="_blank" href="http://smallactsmanifesto.org" title="Small Acts Manifesto">
<img src="http://smallactsmanifesto.org/static/images/smallacts-badge-80x15.png"
style="border: none;"
alt="Small Acts Manifesto"
/>
</a>
</p>
</hgroup>
</header>
</div>
</div>
</div> <div class="pure-u-1">
<div class="content">
<div class="google-search">
<script>
(function() {
var cx = '013207087308420121210:ehs0cs4sbxy';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchbox-only resultsUrl="http://pythonclub.com.br/pages/search.html" newWindow="false" enableAutoComplete=true></gcse:searchbox-only>
</div>
<!-- A wrapper for all the blog posts -->
<div class="posts">
<h1 class="content-subhead">
Postagens com a tag 'function' </h1>
<section class="post">
<header class="post-header">
<a href="http://pythonclub.com.br/author/diego-garcia.html" title="See posts by Diego Garcia">
<img class="avatar" alt="Diego Garcia" src="http://www.gravatar.com/avatar/4674185456254a2f276290992c0891c8">
</a>
<h3><a class="post-title" href="http://pythonclub.com.br/a-armadilha-dos-argumentos-com-valores-padrao.html">A armadilha dos argumentos com valores padrão</a></h3>
<p class="post-meta"><figure style="float:left;">
<img src="/images/drgarcia1986/is_a_trap.png">
</figure>
<p></br>
Algo muito comum em várias linguagens de programação é a possibilidade de definir <em>valores default</em> (valores padrão) para argumentos de funções e métodos, tornando a utilização desses opcional.
Isso é ótimo, principalmente para manter retrocompatibilidade, porém, o python possui uma pequena armadilha que caso passe despercebida, pode causar sérios problemas ...</p></p>
<p>
<a class="pure-button pure-button-primary" href="http://pythonclub.com.br/a-armadilha-dos-argumentos-com-valores-padrao.html">Leia mais...</a>
</p>
<p class="post-meta">
in <a href="http://pythonclub.com.br/category/anti-patterns.html">anti-patterns</a> · Sun 07 June 2015
</p>
</header>
</section><div class="pagination-wrapper content-subhead">
<div class="pagination">
<div class="pagination-left">
</div>
<span>Página 1 / 1</span>
<div class="pagination-right">
</div>
</div>
</div><footer class="footer">
<p>© PythonClub –
Built with <a href="https://github.com/PurePelicanTheme/pure">Pure Theme</a>
for <a href="http://blog.getpelican.com/">Pelican</a>
</p>
</footer> </div>
</div>
</div>
<div class="publish-github">
<a href="https://github.com/pythonclub/pythonclub.github.io">
<img style="position: absolute; top: 0; right: 0; border: 0;"
src="https://raw.githubusercontent.com/pythonclub/pythonclub.github.io/pelican/content/images/pythonclub_geral/forkme_dark-red_background-pythonclub01.png"
alt="Publique via GitHub"
data-canonical-src="https://raw.githubusercontent.com/pythonclub/pythonclub.github.io/pelican/content/images/pythonclub_geral/forkme_dark-red_background-pythonclub01.png">
</a>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="http://pythonclub.com.br/theme/js/dynamic_random_articles.js"></script>
<script>
var $top = $('.go-top');
// Show or hide the sticky footer button
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$top.fadeIn(200);
} else {
$top.fadeOut(200);
}
});
// Animate the scroll to top
$top.click(function(event) {
event.preventDefault();
$('html, body').animate({scrollTop: 0}, 300);
})
// Makes sure that the href="#" attached to the <a> elements
// don't scroll you back up the page.
$('body').on('click', 'a[href="#"]', function(event) {
event.preventDefault();
});
$(function(){
show_random_articles($('#random-articles'), [{"url": "http://pythonclub.com.br/raspando-a-web-com-python-parte-1.html", "title": "Raspando a Web com Python: Introdu\u00e7\u00e3o"}, {"url": "http://pythonclub.com.br/instalando-pycharm-ubuntu.html", "title": "Instalando o PyCharm no Ubuntu (e irm\u00e3os)"}, {"url": "http://pythonclub.com.br/a-armadilha-dos-argumentos-com-valores-padrao.html", "title": "A armadilha dos argumentos com valores padr\u00e3o"}, {"url": "http://pythonclub.com.br/desenvolvendo-para-google-app-engine-com-tekton.html", "title": "Cria\u00e7\u00e3o de aplica\u00e7\u00f5es no Google App Engine com o Tekton"}, {"url": "http://pythonclub.com.br/django-introducao-queries.html", "title": "Como otimizar suas consultas no Django - De N a 1 em 20 minutos"}, {"url": "http://pythonclub.com.br/django-overview-10-minutos.html", "title": "Django - 3 anos em 10 minutos"}, {"url": "http://pythonclub.com.br/configurando-ambiente-django-com-apache-e-mod-wsgi.html", "title": "Configurando ambiente Django com Apache e mod_wsgi"}, {"url": "http://pythonclub.com.br/tuplas-mutantes-em-python.html", "title": "Tuplas mutantes em Python"}, {"url": "http://pythonclub.com.br/postgresql-e-django.html", "title": "PostgreSql e Django - parte 3"}, {"url": "http://pythonclub.com.br/postgresql-e-python3.html", "title": "PostgreSql e Python3 - parte 2"}, {"url": "http://pythonclub.com.br/microframework-contra-baterias-incluidas.html", "title": "Microframework contra "Baterias Inclu\u00eddas""}, {"url": "http://pythonclub.com.br/debugging-em-python-sem-ide.html", "title": "Debugging em python (sem IDE)"}, {"url": "http://pythonclub.com.br/tutorial-postgresql.html", "title": "Tutorial PostgreSql - parte 1"}, {"url": "http://pythonclub.com.br/conteinerizando-suas-aplicacoes-django-com-docker-e-fig.html", "title": "Conteinerizando suas aplica\u00e7\u00f5es django com docker e fig"}, {"url": "http://pythonclub.com.br/publicando-seu-hello-world-no-heroku.html", "title": "Publicando seu Hello World no Heroku"}, {"url": "http://pythonclub.com.br/entrevista-henrique-bastos.html", "title": "Entrevista com Henrique Bastos"}, {"url": "http://pythonclub.com.br/testes-de-carga-com-o-locust.html", "title": "Testes de carga com o Locust"}, {"url": "http://pythonclub.com.br/tutorial-django-17.html", "title": "Tutorial Django 1.7"}, {"url": "http://pythonclub.com.br/integrando-django-com-cloudinary.html", "title": "Integrando o Django com Cloudinary"}, {"url": "http://pythonclub.com.br/bottle-framework-full-stack-sem-django.html", "title": "Bottle Framework full stack sem Django"}, {"url": "http://pythonclub.com.br/desenvolvendo-com-bottle-parte-1.html", "title": "Desenvolvendo com Bottle - Parte 1"}, {"url": "http://pythonclub.com.br/gerenciando-banco-dados-sqlite3-python-parte2.html", "title": "Gerenciando banco de dados SQLite3 com Python - Parte 2"}, {"url": "http://pythonclub.com.br/solucao-quase-definitiva-para-permissoes-em-projetos-django.html", "title": "Solu\u00e7\u00e3o (quase) definitiva para permiss\u00f5es em projetos Django"}, {"url": "http://pythonclub.com.br/gerenciando-assets-com-django-pipeline.html", "title": "Gerenciando assets com django-pipeline"}, {"url": "http://pythonclub.com.br/deploy-app-django-openshift.html", "title": "Deploy App Django no Openshift"}, {"url": "http://pythonclub.com.br/criando-sites-estaticos-com-pelican.html", "title": "Criando sites est\u00e1ticos com Pelican Framework"}, {"url": "http://pythonclub.com.br/selenium-parte-4.html", "title": "Selenium - O que voc\u00ea deveria saber - Parte 4"}, {"url": "http://pythonclub.com.br/configurando-um-servidor-de-producao-para-aplicacoes-python.html", "title": "Configurando um servidor de produ\u00e7\u00e3o para aplica\u00e7\u00f5es Python"}, {"url": "http://pythonclub.com.br/what-the-flask-pt-2-flask-patterns-boas-praticas-na-estrutura-de-aplicacoes-flask.html", "title": "What the Flask? Pt-2 Flask Patterns - boas pr\u00e1ticas na estrutura de aplica\u00e7\u00f5es Flask"}, {"url": "http://pythonclub.com.br/gerenciando-banco-dados-sqlite3-python-parte1.html", "title": "Gerenciando banco de dados SQLite3 com Python - Parte 1"}, {"url": "http://pythonclub.com.br/introducao-classes-metodos-python-basico.html", "title": "Introdu\u00e7\u00e3o a Classes e M\u00e9todos em Python (b\u00e1sico)"}, {"url": "http://pythonclub.com.br/pyftpdlib-criando-um-servidor-ftp-simples-com-python.html", "title": "pyftpdlib - Criando um servidor FTP simples com python"}, {"url": "http://pythonclub.com.br/usando-redis-cache-django.html", "title": "Usando Redis para cache e sess\u00e3o do Django"}, {"url": "http://pythonclub.com.br/aprendendo-e-ensinando-python.html", "title": "Aprendendo e Ensinando Python"}, {"url": "http://pythonclub.com.br/selenium-parte-3.html", "title": "Selenium - O que voc\u00ea deveria saber - Parte 3"}, {"url": "http://pythonclub.com.br/what-the-flask-pt-1-introducao-ao-desenvolvimento-web-com-python.html", "title": "What the Flask? Pt-1 Introdu\u00e7\u00e3o ao desenvolvimento web com Python"}, {"url": "http://pythonclub.com.br/selenium-parte-2.html", "title": "Selenium - O que voc\u00ea deveria saber - Parte 2"}, {"url": "http://pythonclub.com.br/guia-rapido-comandos-sqlite3.html", "title": "Guia r\u00e1pido de comandos SQLite3"}, {"url": "http://pythonclub.com.br/editando-o-admin-do-django.html", "title": "Editando o Admin do Django"}, {"url": "http://pythonclub.com.br/instalacao-python-django-windows.html", "title": "Instalando e Configurando o Python e Django no Windows"}, {"url": "http://pythonclub.com.br/criar-site-com-form-lista-30-min.html", "title": "Como criar um site com formul\u00e1rio e lista em 30 minutos?"}, {"url": "http://pythonclub.com.br/principais-duvidas-de-quem-quer-aprender-django.html", "title": "Principais d\u00favidas de quem quer aprender Django"}, {"url": "http://pythonclub.com.br/parseando-sites-com-beautifulsoup.html", "title": "Exemplo de como "Parsear" Sites com BeautifulSoup"}, {"url": "http://pythonclub.com.br/deploy-com-django-fagungis.html", "title": "Publica\u00e7\u00e3o de projetos com o Django-Fagungis"}, {"url": "http://pythonclub.com.br/como-fazer-fork-clone-push-pull-request-no-github.html", "title": "Como fazer fork, clone, push pull-request no Github"}, {"url": "http://pythonclub.com.br/primeiro-projeto-django-no-linux-com-sublime.html", "title": "Seu primeiro projeto Django com Sublime Text no Linux"}, {"url": "http://pythonclub.com.br/introducao-a-testes-funcionais-com-selenium-e-python.html", "title": "Introdu\u00e7\u00e3o a testes funcionais com Selenium e Python"}, {"url": "http://pythonclub.com.br/selenium-parte-1.html", "title": "Selenium - O que voc\u00ea deveria saber - Parte 1"}, {"url": "http://pythonclub.com.br/5-django-apps-que-nao-vivo-se.html", "title": "5 Django Apps que n\u00e3o vivo sem"}, {"url": "http://pythonclub.com.br/sobre-o-six-e-como-ele-ajuda-a-escrever-codigo-compativel-com-python-2-e-3.html", "title": "Sobre o six e como ele ajuda a escrever c\u00f3digo compat\u00edvel com python 2 e 3"}, {"url": "http://pythonclub.com.br/como_colaborar_com_projetos_open_source.html", "title": "Como colaborar na tradu\u00e7\u00e3o do Djangobook sem conhecer programa\u00e7\u00e3o"}], 10);
});
</script>
<div id="spot-im-root"></div>
<script type="text/javascript">!function(t,o,p){function e(){var t=o.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"==o.location.protocol?"https":"http")+":"+p,o.body.appendChild(t)}t.spotId="3de816246c80a51757bb01c5b8c95cda",t.spotName="",t.allowDesktop=!0,t.allowMobile=!1,t.containerId="spot-im-root",e()}(window.SPOTIM={},document,"//www.spot.im/embed/scripts/launcher.js");</script>
</body>
</html>