Pybites

12K posts

Pybites banner
Pybites

Pybites

@pybites

Helping people worldwide to improve their #Python + #developer + #mindset skills. Created by @bbelderbos & @juliansequeira. Join us: https://t.co/3aXqzdlZWx

Worldwide Katılım Aralık 2016
241 Takip Edilen31.1K Takipçiler
Sabitlenmiş Tweet
Pybites
Pybites@pybites·
Got this nice review for rustplatform.com 😍 If you want to take your Rust 🦀 + programming skills to the next level as a Pythonista, check it out; this platform is made for #Python people 🐍📈
Pybites tweet media
English
0
1
5
1.3K
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
I keep meeting #Python devs who *want* to learn #Rust but never start. So here's a nice challenge: 15 free Rust bites, one a day for the next 2 weeks. 🦀
Bob Belderbos tweet media
English
1
2
9
650
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
After experiencing more awesomeness with `match` in #rust (thanks @jhodapp) I cannot wait to see how far I can stretch it in #python 🦀 🐍
Bob Belderbos tweet media
GIF
English
1
1
2
314
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
Drop duplicates in one call using `set`: #python
Bob Belderbos tweet media
English
0
2
1
316
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
Most people learn Rust for performance. 🦀 And although that appealed to me too, it's actually the compiler + strictness that made me stay.
Bob Belderbos tweet media
English
2
1
4
530
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
In Python, any code can set `obj.balance = -1000`; there's no enforcement. In Rust, struct fields are private by default. You choose which fields to expose, and the compiler enforces it. Practice this: rustplatform.com/visibility-rul… #python #rust
Bob Belderbos tweet media
English
0
1
5
554
Pybites
Pybites@pybites·
Example:
Pybites tweet media
English
0
0
2
189
Pybites
Pybites@pybites·
None, the billion-dollar mistake ... A function can hand you `None`, and the developer needs to check it. The bug isn't the `None` per se. The bug is that the language lets you ignore it until it blows up at runtime. #Rust doesn't have `null`. 📈 A function that might not return a value returns `Option` (`Some(value)` or `None`) The compiler refuses to let you touch the inner value until you've handled both cases. Forgot the `None` arm? It won't compile. 😅 The whole class of "surprise None two layers deep" bugs is gone before you even run the program. And you don't have to write `match` everywhere either; combinators like `.map()` and `.unwrap_or()` chain the happy path cleanly. If you've ever been bitten by `AttributeError: 'NoneType'...` (probably all Pythonistas), try the exercise below; it might open your eyes to Rust's 🦀 safety aspects ...
English
2
1
4
1.2K
Charlie Marsh
Charlie Marsh@charliermarsh·
Ruff was, effectively, my first open source project
Charlie Marsh tweet media
English
18
3
613
31.1K
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
An interesting thing is happening in Python land the last few years. Many developers are running Rust 🦀 every day. You might not realize it, but: - You run Ruff / uv / ty -> Rust - You use Polars or Pydantic -> Rust - You swap out pre-commit by Prek and/or use just -> Rust
Bob Belderbos tweet media
English
1
1
5
619
Pybites
Pybites@pybites·
Learn Rust concepts in a more fun way, going from concepts you already know. 💡
English
1
0
2
397
Pybites
Pybites@pybites·
New exercise track 🎉 #unix classics: wc, head, grep, cut, sort, sed ... up to a top_words capstone: `tr -s ' ' '\n' < file | sort | uniq -c | sort -rn | head` Taught from #Python. 🐍 You rebuild them in #Rust. 🦀
Pybites tweet media
English
1
2
4
937
Pybites retweetledi
Bob Belderbos
Bob Belderbos@bbelderbos·
I really like #Rust's Result type 🦀
Bob Belderbos tweet media
English
1
1
9
1K