Monty @ The Python Coding Place

827 posts

Monty @ The Python Coding Place banner
Monty @ The Python Coding Place

Monty @ The Python Coding Place

@ThePythonPlace

I'm Monty, Chief Mischief Officer at The Python Coding Place.

Worldwide Присоединился Ocak 2023
48 Подписки646 Подписчики
Monty @ The Python Coding Place
Monty @ The Python Coding Place@ThePythonPlace·
Your call… There’s • a super-personalised one-to-one 6-month mentoring option $ 4,750 • individual one-to-one sessions $ 125 • a self-led route with access to 60+ hrs of exceptional video courses and a support forum $ 400 Which The Python Coding Place student are you?
English
1
3
2
211
Monty @ The Python Coding Place ретвитнул
Stephen Gruppetta
Stephen Gruppetta@s_gruppetta·
@ThePythonPlace Great to see more and more people enjoying these courses. I had so much fun recording them…
English
0
1
0
37
Monty @ The Python Coding Place
Monty @ The Python Coding Place@ThePythonPlace·
@s_gruppetta I reckon `.__monty__()` should exist as a valid special method—the specialest of all special methods. Who’s with me on this? Let’s start a petition…
English
0
0
0
45
Stephen Gruppetta
Stephen Gruppetta@s_gruppetta·
`.__george__()` In a recent course, a student asked my whether it's possible to create new special methods by using leading and trailing double underscores in the name. No. But you can* define a method with leading and trailing double underscores if you want * you can…but you shouldn't The student's name was George (it still is, technically), so we wrote this dummy class: ``` >>> class SpecialStuff: ... def __george__(self): ... print("There's nothing special to see here!") ... ``` This code "works": ``` >>> stuff = SpecialStuff() >>> stuff.__george__() There's nothing special to see here! ``` So you _can_ define a method with leading and trailing double underscores in its name. But there's nothing special about `.__george__()`. Sorry George, don't take it personally. It's just a normal method. What makes special methods special is not the double underscore syntax–that's just a way to easily identify them. What makes, say, `.__add__()` special is its role within the Python language–Python looks for this method when you use the `+` operator. So, why shouldn't you create methods with leading and trailing double underscores. After all, they look cool? Because you'll confuse everyone else who reads your code. Readability matters. A lot. Someone reading your code might look puzzlingly at the `.__george__()` looks-like-special method. They'll spend hours, days, weeks, years looking for it in the documentation to see what it does behind the scenes in Python… …and do you want to be responsible for these years lost from so many programmers' lives looking for a special method that doesn't exist?
English
1
1
0
220
Monty @ The Python Coding Place ретвитнул
Monty @ The Python Coding Place
Monty @ The Python Coding Place@ThePythonPlace·
What's better than a thorough, relaxed, and friendly Python course? 12 of them (plus a bit more, too), all in one bundle, all for just $400 …and yes, you get access to a forum where you can ask questions, too The only risk is in missing out… thepythoncodingplace.thinkific.com/bundles/the-py…
English
1
2
3
215
Monty @ The Python Coding Place
Monty @ The Python Coding Place@ThePythonPlace·
@s_gruppetta No coding knowledge + The Python Coding Place membership = Intermediate programmer Little coding knowledge + The Python Coding Place membership = Great programmer Intermediate coding knowledge + The Python Coding Place membership = Superpower-like programmer
English
0
1
1
191
Stephen Gruppetta
Stephen Gruppetta@s_gruppetta·
No coding knowledge = Little benefit from AI Little coding knowledge = Intermediate benefit from AI Intermediate coding knowledge = Great benefit from AI Great coding knowledge = Superpower-like benefit from AI
English
1
1
1
307
Monty @ The Python Coding Place
Monty @ The Python Coding Place@ThePythonPlace·
@mathsppblog The idea was to highlight that it's not in a group as it's a personalised offer for an individual, but I see your point. Monty will now go to ponder…
English
1
0
1
13
Stephen Gruppetta
Stephen Gruppetta@s_gruppetta·
Consider this code to find how often words appears in a text: ``` all_words = {} for word in list_of_words: if word in all_words: all_words[word] += 1 else: all_words[word] = 1 ``` Many will react to this with: > "Ah, but you should use ... instead" [With `Counter` being the most common response] But I use this code in my beginners' book and in beginners' courses I teach Why? Because I'm not teaching them how to find words in a text. I'm teaching them how to code, how to think with a programming mindset, how to master the basic tools. This didactic approach happens in all aspects of teaching. Virtually all material children learn at primary school is simplified and "not how I'd do it". A lot of what they learn in secondary school is, too. And there's a reason for that. You need to learn to walk before you can run… So when you see some code "you'd do differently", think about who's the intended audience. Maybe, that's the right code for them!
English
2
0
8
336
Rodrigo 🐍🚀
Rodrigo 🐍🚀@mathsppblog·
There's a fundamental rule of Python... That `itertools.tee` breaks! In a couple of hours, I'm sending a deep dive to 11,000+ email subscribers to help them understand how `tee` is able to do what it does! Check the link in my profile to subscribe and to get the deep dive too!
English
1
0
1
517
Marlene Mhangami
Marlene Mhangami@marlene_zw·
Working from home today, but here's my obligatory 1st day back at work photo❤️ There's never been a better time to be a Python programmer interested in AI! Python is still the number 1 language used to build AI Agents in. New year, same Pythonic vibes 👩🏾‍💻🐍✨
Marlene Mhangami tweet media
English
4
2
40
1.6K