Rodrigo GirΓ£o SerrΓ£o πŸπŸš€'s Avatar

Rodrigo GirΓ£o SerrΓ£o πŸπŸš€

@mathspp.com.bsky.social

I'll help you take your Python skills to the next level! Get a daily drop of Python knowledge πŸπŸ’§ -> https://mathspp.com/drops Pydon'ts – free Python book πŸ‘‰ https://mathspp.com/books/pydonts

1,050 Followers  |  296 Following  |  846 Posts  |  Joined: 21.11.2024  |  1.8666

Latest posts by mathspp.com on Bluesky

Preview
Episode #259: Design Patterns That Don't Translate to Python – The Real Python Podcast Do the design patterns learned in other programming languages translate to coding in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and…

On this week's episode, @digiglean.bsky.social and I talk about lots of releases, using coverage to make sure your tests are running, t-strings, and much more.

With content from: @willmcgugan.bsky.social @simonwillison.net @hugovk.dev @martinfowler.com @mitsuhiko.at and others.

01.08.2025 15:34 β€” πŸ‘ 7    πŸ” 3    πŸ’¬ 0    πŸ“Œ 0
Diagram showing that the keyword `elif` and an `else` followed by an `if` are treated the same at the level of the AST in Python.

Diagram showing that the keyword `elif` and an `else` followed by an `if` are treated the same at the level of the AST in Python.

The Python keyword `elif` is a lie!

But they don't want you to know that!

You are welcome.

01.08.2025 15:22 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
What the Python?! – Lightning talk by Rodrigo GirΓ£o SerrΓ£o at PyCon Portugal 2025
YouTube video by Rodrigo πŸπŸš€ What the Python?! – Lightning talk by Rodrigo GirΓ£o SerrΓ£o at PyCon Portugal 2025

What the Python?!

At PyCon Portugal πŸ‡΅πŸ‡Ή I gave a lightning talk (5-min talk) where I showed a bunch of seemingly random Python behaviours.

Maybe 6 or 7.

Watch the talk and let me know how many of these you already knew πŸ‘‡

youtu.be/QxfdLDyCypI

28.07.2025 19:55 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Just found out about `pp` and `pformat`.

28.07.2025 19:04 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Glad I could help :D

28.07.2025 19:04 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Thanks for letting me know!

28.07.2025 19:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Printing the dictionary with keys sorted sounds kinda nice for readability 🀷

No?

28.07.2025 19:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Does anyone here ever use `pprint.pprint`?

I always forget this exists...

28.07.2025 12:06 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 6    πŸ“Œ 0

Enjoy!

26.07.2025 16:47 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

clicking a number in the grid could highlight all other instances of the same number.

That'd make it easier to scan the grid :D

These are just random thoughts, though.

26.07.2025 16:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

This is fun, thanks for the game!

It took me a while to realise that β€œ0” is a valid number in this sudoku version 🀦

Would be cool if the numbers in the clickable input region got grayed out as you complete them.

Also, since the grid is huge and it takes ages to scan,

26.07.2025 16:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Nice :D I don't use fish, though πŸ€ͺ

26.07.2025 16:23 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Use

`pbcopy < file.txt`

To copy the contents of the file.txt to your clipboard.

(MacOS-only, I believe.)

26.07.2025 10:50 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Congratulations & good luck! Thankfully, you still have some time to prepare :D

(Side quest: come up with 3.16 stickers that are nicer than @hugovk.dev's 3.14 stickers!)

26.07.2025 09:37 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Join the Python 🐍 Lisbon Meetup Discord Server! Discord server for the Python Lisbon Meetup community. | 3 members

We're announcing this β€œofficially” at the @pyconpt.bsky.social lightning talks today!

If you'd like to stay in touch to join our monthly meetings, here's a Discord link πŸ‘‡

discord.gg/DCNEYDKw9s

25.07.2025 13:23 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
An image generated by AI that contains the title β€œPython Lisbon Meetup” written at the top. The image is in shades of blue and yellow, alluding to the Python logo. The blue and yellow elements are references to the city of Lisbon, Portugal.

An image generated by AI that contains the title β€œPython Lisbon Meetup” written at the top. The image is in shades of blue and yellow, alluding to the Python logo. The blue and yellow elements are references to the city of Lisbon, Portugal.

Who can guess what's coming? πŸ€”

πŸ‡΅πŸ‡Ή ❀️ 🐍

25.07.2025 13:23 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
A picture in a large hall showing a PyCon Portugal banner that reads β€œWelcome to PyCon Portugal 2025”.

A picture in a large hall showing a PyCon Portugal banner that reads β€œWelcome to PyCon Portugal 2025”.

A poorly-framed picture showing 4 PyCon Portugal organisers in the distance and a screen next to them showing the message β€œWelcome to the 4th edition of PyCon Portugal”

A poorly-framed picture showing 4 PyCon Portugal organisers in the distance and a screen next to them showing the message β€œWelcome to the 4th edition of PyCon Portugal”

PyCon Portugal πŸ‡΅πŸ‡Ή is starting!

(A bit late, but it's starting nonetheless!)

Wish me luck – hopefully no one else cancels their talk last-minute!

P.S. I need an idea for a lightning talk... What do you suggest?

24.07.2025 08:26 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Table that shows all combinations of using \b and \B around a word pattern, showing how to match standalone words, infixes, suffixes, and prefixes, with regular expressions.

Table that shows all combinations of using \b and \B around a word pattern, showing how to match standalone words, infixes, suffixes, and prefixes, with regular expressions.

Here's a table with the base word β€œlegal” and all combinations of \b & \B around the word.

23.07.2025 12:29 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Now, you do πŸ˜‰

This was the tip I sent yesterday to my Python drops πŸπŸ’§ newsletter.

Most folks also didn't know about it.

23.07.2025 12:13 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Just scheduled the 100th Python drop! πŸπŸ’§

Over the past ~20 weeks I've sent 100 short, actionable Python tips to folks who want to keep improving their Python skills.

If you don't want to miss any more tips, sign up here πŸ‘‰ mathspp.com/drops

23.07.2025 12:11 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

By the way, by default, \b and \B consider β€œword characters” to be alphanumeric characters and the underscore.

So \b and \B work really well with punctuation, too.

Pretty neat :D

23.07.2025 12:10 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Yesterday I learned that you can use \B in regular expressions to match _inside_ words.

So, combining \b and \B you can match prefixes or suffixes.

For example:

\bwater\B – matches β€œwater” as a prefix

I like watermelon βœ…
Drink water every day ❌
Is "tidewater" a real word? ❌

23.07.2025 10:47 β€” πŸ‘ 6    πŸ” 1    πŸ’¬ 2    πŸ“Œ 0
Markdown Here Markdown Here is an extension for Chrome, Firefox, and Thunderbird that allows you to write email in Markdown

Does anyone use anything similar to β€œMarkdown Here” markdown-here.com that lets you write your emails with Markdown and then uses the markdown syntax to format your email appropriately?

I had never heard about this but β€œMarkdown Here” doesn't work for Safari 😬

22.07.2025 22:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Sem problema! A oferta Γ© ΓΊtil Γ  mesma.

21.07.2025 13:38 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I meant Friday πŸ˜‚

21.07.2025 13:37 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Thank you for stepping up, Luciano!

Don’t take me wrong but I’ll try to find someone to present in person.
I’ll reach out to you in ~48 hours if I fail or sooner if I succeed!

21.07.2025 13:32 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Looking down on many tables of sprinters.

Looking down on many tables of sprinters.

Sprinters at their laptops.

Sprinters at their laptops.

Sprinters at their laptops.

Sprinters at their laptops.

An array of snacks and sweets including one with a written warning poster: "VERY SPICY. EAT ONE A TIME. CAROLINA RIPPERS. WASH FINGERS." Plus two types of Finnish salmiakki which should have a warning, and a big rainbow unicorn balloon.

An array of snacks and sweets including one with a written warning poster: "VERY SPICY. EAT ONE A TIME. CAROLINA RIPPERS. WASH FINGERS." Plus two types of Finnish salmiakki which should have a warning, and a big rainbow unicorn balloon.

Thanks to everyone for taking part in the #CPython sprint at #EuroPython2025!

Across all CPython repos this weekend:

* 122 PRs created (69 the previous weekend)
* 79 PRs merged (65)
* countless invaluable in-person discussions (a few?)

#EuroPython #Python #sprint #Prague

21.07.2025 12:53 β€” πŸ‘ 20    πŸ” 8    πŸ’¬ 0    πŸ“Œ 0

You really can't please everyone.

I'm going through the feedback for my EuroPython talk:

Many comments like:
β€œAwesome pacing, great examples”
β€œWell paced”
β€œClear examples”
...

One comment:
β€œTalk was too slow and I would have liked better examples”

πŸ€ͺ🀑

21.07.2025 11:15 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Who's up for showing up at @pyconpt.bsky.social this Thursday to give a 30 minute talk?

We just had a last-minute cancellation!

21.07.2025 10:06 β€” πŸ‘ 3    πŸ” 2    πŸ’¬ 2    πŸ“Œ 1

I am REALLY excited about the full documentary that's coming out this Summer.

21.07.2025 10:06 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@mathspp.com is following 20 prominent accounts