Python Chat

797 posts

Python Chat banner
Python Chat

Python Chat

@PythonChat

Live webcasts for #Python developers. Tweets by @treyhunner.

参加日 Nisan 2016
2 フォロー中2.6K フォロワー
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
Does your company have an individual training budget that expires at the end of year? 💸 If you use #Python at work, sign up for the @PythonMorsels All Access plan and submit your training reimbursement before year end. 🐍💼 pythonmorsels.com/all-python-exe…
English
1
4
5
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
Managing a #Python team and want to chat about your team's skill trajectory? I have ideas & opinions! I'd love to chat about: 1. On-boarding new hires 📋 2. Fostering kind code style discussions 🐕 3. Learning from each other regularly 👩‍🏫 4. Team learning in general 🤔 DM me 💬
English
0
2
8
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
New blog post: What's great about #Python 3.10? There's some fun new features, but improved error messages are *the* winning Python 3.10 feature. treyhunner.com/2021/10/whats-…
English
8
44
121
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
When we use keyword/named arguments, it's the name that matters, not the position Read the full article: Keyword (Named) Arguments in Python: How to Use Them ▸ trey.io/U92hu3 #Python
English
0
2
3
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
Our class instantiation syntax in Python is the same as our function call syntax. Instead of "new SomeClass()" we write "SomeClass()". Because of this we use the word "function" in a fuzzy way: "function" is often used to mean "callable". pythonmorsels.com/topics/callabl…
Python Morsels@PythonMorsels

A callable is an object that you can call. Functions are callables in #Python, but so are classes (many of the "built-in functions" are actually classes). pythonmorsels.com/topics/callabl…

English
2
3
14
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
In #Python, you can pass function objects as an argument to another function. In fact, some of the built-in functions, like sorted, specifically accept functions as an argument. pythonmorsels.com/topics/passing…
English
0
2
7
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
You can break up long lines of #Python code with implicit line continuation. PEP 8 recommends relying on implicit line continuation instead of putting a \ at the end of lines to continue them. pythonmorsels.com/topics/breakin…
English
0
2
5
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
If you're new to list comprehensions in #Python, I recommend writing your comprehensions by copy-pasting your way from a "for" loop. This way you can anchor your understanding of comprehensions on your existing knowledge of "for" loops. pythonmorsels.com/topics/turning…
English
0
6
15
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
Something folks often ask me in my Python trainings: are immutable objects the same as constants? 🤔 They're not! 😮 Immutable objects stop you from mutating an object but constants stop you from assigning to a variable (remember: variables are pointers in Python). 🐍🍪
Python Morsels@PythonMorsels

We have immutable objects in Python but we don't have constant variables. The UPPERCASE_CONVENTION for constants is just a naming convention in #Python. It doesn't stop variables from being re-assigned. pythonmorsels.com/topics/python-…

English
1
5
13
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
We have immutable objects in Python but we don't have constant variables. The UPPERCASE_CONVENTION for constants is just a naming convention in #Python. It doesn't stop variables from being re-assigned. pythonmorsels.com/topics/python-…
English
0
2
5
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
Checking an object's truthiness checks for non-emptiness and non-zero-ness. FYI: the #Python docs don't mention "truthy" or "falsey" even once. The docs call it "truth value testing" but Pythonistas rarely use that phrase colloquially. pythonmorsels.com/topics/truthin…
English
0
1
1
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
Instead of using hard-coded indices to get tuple elements, use tuple unpacking to give descriptive names to each item. Important items should have a name instead of a number. #Python pythonmorsels.com/topics/tuple-u…
English
1
5
8
0
Python Chat がリツイート
Trey Hunner
Trey Hunner@treyhunner·
Let's look at different techniques for counting the number of times things appear in a list. Read more 👉 trey.io/wV2O5R #python
English
0
5
9
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
Parentheses in #Python's class & function definitions mean different things In a function definition, parentheses after the name denote the functions' arguments. In a class definition, parentheses after the name denote the class' parent classes. pythonmorsels.com/topics/inherit…
English
0
1
1
0
Python Chat がリツイート
Python Morsels
Python Morsels@PythonMorsels·
The first method you'll see in most #Python classes is the init method. This isn't a constructor method but an initializer method (because by the time init is called, a new class instance has already been "constructed") pythonmorsels.com/topics/what-is…
English
0
7
11
0