@pybites

Helping people worldwide to improve their #Python #developer skills. Created by @bbelderbos & @juliansequeira.

Worldwide
Joined December 2016
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 🐍📈
1
1
6
1,485
Learning #Python 🐍 syntax isn't the hard part. It’s everything around it where beginner devs typically get stuck: - the terminal / SSH keys, - git and the GitHub PR flow, - virtual environments, - dependencies and packaging, - writing your first tests, - linting, - etc. Overkill for a single script. But all needed for shipping / sharing an app. I'm building a free, self-paced 6-week course to help Pythonistas learn all this and more. We do that by building a command line app from scratch using these tools + workflows. Week 1 - Project Setup & Data Model - is live now 🎉 belderbos.dev/foundations/ Each Friday I'll launch the next week of content - more info in my launch post -> belderbos.dev/blog/free-pyth… Hope this helps more Python developers ship their projects with confidence. 🚀 Enjoy and any feedback welcome, let's go! 💪 🙏
2
1
6
477
My goto for a swappable backend in #python has been an abstract base class (ABC). There is a flexible alternative though: Protocol (typing module). Take LLM providers as an example. An ABC comes with a requirement: every provider has to inherit from your base class. Fine when you write every provider yourself, less so when they're third-party plugins. `typing.Protocol` uses "structural typing" instead. Conformance lives in the method shape, not in a shared base class. So a provider can evolve freely as long as the shape holds, and inherits no methods it doesn't use. And the type checker still catches a missing method or wrong signature at lint time. I still reach for ABCs when providers share concrete behavior, but protocols are the more flexible default. So next time ask: shared contract, or shared implementation? More in my new article: belderbos.dev/blog/protocol-…
1
2
5
336
What are you building with #Python this week?
2
2
1,021
Increasingly #python libraries get rewritten in #rust. Curious about this safe + performant language? Start from scratch on our Pythonista-friendly platform: rustplatform.com/
How do libraries run #Rust inside #Python? It all comes down to 4 steps: 1. Write Rust code. 2. Annotate it with PyO3 macros. 3. Let maturin compile and install it. 4. Import the result. New article seeing this in action for a hand-rolled JSON parser: belderbos.dev/blog/how-libra…
3
1,063
The best features come from listening to your people 💡 > my local Python users group wanted to know if the free tier included a leaderboard or not as they thought it might be a fun activity for one of their meetings.
2
2
3
5,899
We've just added this. 🎉 Docs page: pybitesplatform.com/docs/mee… We hope that people running #Python meetups, workshops, or classrooms will benefit from this feature to make those events more engaging adding live coding + friendly competition. 🏆
1
188
AI made building fast. That includes building the wrong thing faster. Before writing code, you need a tight scope: what to build, and more importantly, what NOT to build. I built a simple tool to pressure-test your idea before you spend weeks building it:
3
3
1
10
686
Now apart from learning #rust by coding practical exercises, you can also discuss them upon solving ->
Coding is nice, talking about code can be even more interesting. #Rust platform feedback / request: > I am missing the discussion about different solutions I remember from PyBites. That was the best part of the platform for me. Great idea and live now! 🎉
4
1,071
What is the output of below Python (3.15) code and why? a. {'a': 1, 'b': 2, 'c': 4} b. {'a': 1, 'b': 99, 'c': 4} c. {'b': 99, 'c': 4, 'a': 1} d. TypeError
2
1
3
631
Code it here → rustplatform.com/mini-parser And share the 🥷 belt you've obtained with me (@bbelderbos) and @pybites
1
1
2
578
Curious about Rust to add a robust language to your tool belt, start here: rustplatform.com/
1
3
342
#Rust makes you write more robust code. 🚀 You come back to #Python with new things to think about, for example exhaustive matching. In Python 3.11 the `assert_never()` helper was added to accomplish this.
2
1
5
554
Day 10 · Basic Tokenizer 🦀 Ok, after 9 concept days/exercises, time to build something more real in #Rust. 💪 In Bite #10 you'll turn raw text into tokens. The first step every parser, compiler and interpreter takes.
2
1
1
8
1,613
Day 13 · Custom Error Types 🦀 Python: subclass a built-in exception (e.g. `Exception`) #Rust: define an `enum` of everything that can go wrong.
2
1
4
431
Python made me lazy about how my code actually runs. #Rust fixed that. 5 reasons to pick it up sooner rather than later:
2
1
11
2,074
Replying to @owenthcarey
I think we still should right? AI or not, keep the friction + intuition! Biased (creator) but preferring @pybites for this because it's less heavy on algos, more on core python and rust.
1
2
282
Come learn #Rust with us, you won't be disappointed 😄 💡 🦀
Day 10 · Basic Tokenizer 🦀 Ok, after 9 concept days/exercises, time to build something more real in #Rust. 💪 In Bite #10 you'll turn raw text into tokens. The first step every parser, compiler and interpreter takes.
5
1,100