SlideShare a Scribd company logo
DETONANDO
 MITOS EM
  PYTHON
DENIS COSTA
@deniscostadsc
“Existem alguns mitos
no mundo do python...”
“...e nós vamos
detoná-los hoje.”
“Tipo
Regex”
r'<[^>]*>'
r'Raw String'
>>> print('nn1')


1
>>> print(r'nn1')
nn1
>>>   backslash = ''
>>>   print(backslash)

>>>   raw_string = re.compile(r'')
>>>   raw_string.sub('1', backslash)
'1'
>>>   backslash = ''
>>>   print(backslash)

>>>   normal_string = re.compile('')
>>>   normal_string.sub('1', backslash)
'1'
Para aprender mais
             http://docs.python.org/2/library/re.html
http://docs.python.org/2/reference/lexical_analysis.html#literals
“O todo
poderoso
encoding”
# -*- encoding: utf-8 -*-
r'coding[:=]s*([-w.]+)'
http://hg.python.org/cpython/file/0e41c4466d58/Parser/tokenizer.c#l208
Emacs
# -*- coding: <encoding name> -*-
Vim
# vim: set fileencoding=<encoding name> :
# coding: utf-8
Para aprender mais
http://www.python.org/dev/peps/pep-0263/
UnicodeDecodeError
Para aprender mais
http://www.youtube.com/watch?v=qa-VkmCSr0s
Quebras de linhas
  onipresentes
a = 1 or 
2
a = (1 or
2)
“Nem por
Odin, suporta
orientação a
  objetos”
>>> l = [1, 2, 3, 4]
>>> len(l)
4
>>> l = [1, 2, 3, 4]
>>> l.__len__()
4
>>> n + 6
7
>>> n = 1
>>> n.__add__(6)
7
Perguntas?

More Related Content

What's hot

Puppet Camp 2012
Puppet Camp 2012Puppet Camp 2012
Puppet Camp 2012
Server Density
 
Realtime Database with iOS and Firebase
Realtime Database with iOS and FirebaseRealtime Database with iOS and Firebase
Realtime Database with iOS and Firebase
NSCoder Mexico
 
BOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containersBOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containers
Benjamin Gandon
 
Всеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.jsВсеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.js
Yandex
 
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونیاسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Yg byev2e
Yg byev2eYg byev2e
Yg byev2e
longphi2812
 
Talk NullByteCon 2015
Talk NullByteCon 2015Talk NullByteCon 2015
Talk NullByteCon 2015
Roberto Soares
 
Biicode OpenExpoDay
Biicode OpenExpoDayBiicode OpenExpoDay
Biicode OpenExpoDay
fcofdezc
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019
cocodrips
 
تذكرة الصيام
تذكرة الصيامتذكرة الصيام
تذكرة الصيام
Muhammadrusdee Almaarify
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
Wojciech Sznapka
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDB
Sqreen
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
Ian Barber
 
MongoDB shell games: Here be dragons .. and JavaScript!
MongoDB shell games: Here be dragons .. and JavaScript!MongoDB shell games: Here be dragons .. and JavaScript!
MongoDB shell games: Here be dragons .. and JavaScript!
Stennie Steneker
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Devcast node.js e mongo db o casamento perfeito
Devcast   node.js e mongo db o casamento perfeitoDevcast   node.js e mongo db o casamento perfeito
Devcast node.js e mongo db o casamento perfeito
Suissa
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
Ian Barber
 
Rustでパケットと戯れる
Rustでパケットと戯れるRustでパケットと戯れる
Rustでパケットと戯れる
ShuyaMotouchi1
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
SmartTools
 

What's hot (20)

Puppet Camp 2012
Puppet Camp 2012Puppet Camp 2012
Puppet Camp 2012
 
Realtime Database with iOS and Firebase
Realtime Database with iOS and FirebaseRealtime Database with iOS and Firebase
Realtime Database with iOS and Firebase
 
BOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containersBOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containers
 
Всеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.jsВсеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.js
 
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونیاسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
اسلاید اول جلسه هشتم کلاس پایتون برای هکرهای قانونی
 
Yg byev2e
Yg byev2eYg byev2e
Yg byev2e
 
Talk NullByteCon 2015
Talk NullByteCon 2015Talk NullByteCon 2015
Talk NullByteCon 2015
 
Biicode OpenExpoDay
Biicode OpenExpoDayBiicode OpenExpoDay
Biicode OpenExpoDay
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019
 
تذكرة الصيام
تذكرة الصيامتذكرة الصيام
تذكرة الصيام
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDB
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
 
MongoDB shell games: Here be dragons .. and JavaScript!
MongoDB shell games: Here be dragons .. and JavaScript!MongoDB shell games: Here be dragons .. and JavaScript!
MongoDB shell games: Here be dragons .. and JavaScript!
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
Devcast node.js e mongo db o casamento perfeito
Devcast   node.js e mongo db o casamento perfeitoDevcast   node.js e mongo db o casamento perfeito
Devcast node.js e mongo db o casamento perfeito
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
 
Rustでパケットと戯れる
Rustでパケットと戯れるRustでパケットと戯れる
Rustでパケットと戯れる
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 

Viewers also liked

CEDTec
CEDTecCEDTec
CEDTec
DESIS_milano
 
Detailed class analysis of music magazine one nme
Detailed class analysis of music magazine one nmeDetailed class analysis of music magazine one nme
Detailed class analysis of music magazine one nme
hanafiftakhar
 
San valentín
San valentínSan valentín
San valentín
janneth bernal
 
Context & trends
Context & trendsContext & trends
Context & trends
Sustainable Brands
 
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
Sustainable Brands
 
Webinar "Hast Du heute schon geMOOCt?"
Webinar "Hast Du heute schon geMOOCt?"Webinar "Hast Du heute schon geMOOCt?"
Webinar "Hast Du heute schon geMOOCt?"
Hedwig Seipel
 

Viewers also liked (7)

CEDTec
CEDTecCEDTec
CEDTec
 
Detailed class analysis of music magazine one nme
Detailed class analysis of music magazine one nmeDetailed class analysis of music magazine one nme
Detailed class analysis of music magazine one nme
 
San valentín
San valentínSan valentín
San valentín
 
Recommendations
RecommendationsRecommendations
Recommendations
 
Context & trends
Context & trendsContext & trends
Context & trends
 
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
Defining the Compe..ve and Financial Advantages of Corporate Responsibility a...
 
Webinar "Hast Du heute schon geMOOCt?"
Webinar "Hast Du heute schon geMOOCt?"Webinar "Hast Du heute schon geMOOCt?"
Webinar "Hast Du heute schon geMOOCt?"
 

Similar to Derrubando mitos em Python

Recursive descent parsing
Recursive descent parsingRecursive descent parsing
Recursive descent parsing
Boy Baukema
 
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
Takashi Kitano
 
pa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processingpa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processing
Rodrigo Senra
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
Tom Crinson
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)
Patricia Aas
 
Accessing hemibrain data using Neuprintr
Accessing hemibrain data using Neuprintr Accessing hemibrain data using Neuprintr
Accessing hemibrain data using Neuprintr
Alexander Bates
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
Programming Homework Help
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
Ram Narasimhan
 
FreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame GraphsFreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame Graphs
Brendan Gregg
 
M12 random forest-part01
M12 random forest-part01M12 random forest-part01
M12 random forest-part01
Raman Kannan
 
Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008
eComm2008
 
Python memory management_v2
Python memory management_v2Python memory management_v2
Python memory management_v2
Jeffrey Clark
 
6 things about perl 6
6 things about perl 66 things about perl 6
6 things about perl 6
brian d foy
 
RedisConf17- durable_rules
RedisConf17- durable_rulesRedisConf17- durable_rules
RedisConf17- durable_rules
Redis Labs
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
John Stevenson
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
mickey24
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporation
Henryk Konsek
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
John Stevenson
 
42: Rise of the dependent types
42: Rise of the dependent types42: Rise of the dependent types
42: Rise of the dependent types
George Leontiev
 

Similar to Derrubando mitos em Python (20)

Recursive descent parsing
Recursive descent parsingRecursive descent parsing
Recursive descent parsing
 
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
 
pa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processingpa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processing
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)
 
Accessing hemibrain data using Neuprintr
Accessing hemibrain data using Neuprintr Accessing hemibrain data using Neuprintr
Accessing hemibrain data using Neuprintr
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
 
FreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame GraphsFreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame Graphs
 
M12 random forest-part01
M12 random forest-part01M12 random forest-part01
M12 random forest-part01
 
Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008Rocky Nevin's presentation at eComm 2008
Rocky Nevin's presentation at eComm 2008
 
Python memory management_v2
Python memory management_v2Python memory management_v2
Python memory management_v2
 
6 things about perl 6
6 things about perl 66 things about perl 6
6 things about perl 6
 
RedisConf17- durable_rules
RedisConf17- durable_rulesRedisConf17- durable_rules
RedisConf17- durable_rules
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporation
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
 
42: Rise of the dependent types
42: Rise of the dependent types42: Rise of the dependent types
42: Rise of the dependent types
 

Derrubando mitos em Python