
Live webcasts for #Python developers. Tweets by @treyhunner.
Joined April 2016
- Tweets797
- Following2
- Followers2.6K
- Likes9
Python Chat retweeted
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…
Python Chat retweeted
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 💬
Python Chat retweeted
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…
Python Chat retweeted
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
Python Chat retweeted
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/bre…
Python Chat retweeted
What is a list comprehension in #Python? What are they used for and how are they different from a for loop?
pythonmorsels.com/topics/wha…
Python Chat retweeted
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/cal…
Python Chat retweeted
Need an attribute that updates its value automatically? Use a property!
In the #Python world, we tend to prefer properties over getter methods.
pythonmorsels.com/topics/mak…
Python Chat retweeted
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/pyt…
Python Chat retweeted
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/tru…
Python Chat retweeted
Let's look at different techniques for counting the number of times things appear in a list.
Read more 👉 trey.io/wV2O5R
#python
Python Chat retweeted
You can think of truthy as meaning non-empty or non-zero
Read the full article: Check Whether All Items Match a Condition in Python
▸ trey.io/6oLi1Z
#Python
Python Chat retweeted
It's January 1, 2001 and we're now using Python 2.0!
Read the full article: Counting Things in Python: A History
▸ trey.io/wV2O5R
#python
Python Chat retweeted
When teaching Python, I've often wished I had a summary of the various keyword argument-related features that I could link learners to.
Read the full article: Keyword (Named) Arguments in Python: How to Use Them
▸ trey.io/U92hu3
#Python
Python Chat retweeted
Note that because our generator is lazy, we stop computing divisibilities as soon as our all function finds a divisible number.
Read the full article: Check Whether All Items Match a Condition in Python
▸ trey.io/6oLi1Z
#Python
Python Chat retweeted
That's quite a bit shorter, but there's a problem: we're building up an entire list just to loop over it once!
Read the full article: Check Whether All Items Match a Condition in Python
▸ trey.io/6oLi1Z
#Python
Python Chat retweeted
Python has a built-in function "all" that returns True if all items are truthy
Read the full article: Check Whether All Items Match a Condition in Python
▸ trey.io/6oLi1Z
#Python
Python Chat retweeted
Functions in #Python accept positional arguments 🔢 and keyword arguments 📛 (aka named arguments). Using keyword arguments when calling a function can often make your code a bit more descriptive.
pythonmorsels.com/topics/pos…
Python Chat retweeted
A back-to-basics Python screencast this week 🎥
A 2 minute video on how to use (call) a function in #Python 📞🐍
pythonmorsels.com/topics/cal…

