Rafael V Liscano (@revliscano) profile picture

Systems engineer.

Joined April 2010
Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)Photo by Rafael V Liscano (@revliscano)
Mutability often confuses new Python programmers, especially when attempting to create copies of a mutable object. See the differences below when only referencing an existent mutable object, and when doing shallow and deep copying. #100DaysOfCode #Python #CodeNewbie #Python3
3
27
3
64
??
I've been singing the blues ever since the world begin
1
235
Reminder: commit early, commit often. I had such a mess earlier today due to mixing a lot of things in the same commit, which I had to modify later to drop certain things from there. If I had made a commit for each step, it would have been a piece of cake.
2
155
This thread is priceless!
Time to reflect on the way I do TDD (I know, there is more than one way to skin a cat; but what matters is that we deliver a skinned cat; btw, what an ugly, gore analogy!):
1
2
I'm learning a new language for the first time in years! Let's see how it is outside Pythonland nowadays...
2
10
My Python Core Language IQ is 259—that’s better than 97% of my peers! What's your #PluralsightIQ? app.pluralsight.com/score/re…
2
I'd like to start revisiting the Itertools Recipes, with one of my favorites: ⏩all_equal(iterable) As its docstring states, it returns True if all the elements are equal to each other But how does it do it? 🤔 Let's see! 🧵
2
3
1⃣groupby(iterable) yields pairs (item, group) for each different item found in iterable. 2⃣If all items in iterable are equal to each other, (let's say [1, 1, 1, 1] then groupby will yield only one pair. (i.e: (1, group) )
1
Y'all need to stop using indentation as a way to denote scopes in Python. Nothing like good old curly braces. Just do: >>> from __future__ import braces To start using them in your code. ... (Thanks to @jamescalam for the great tip)
2
1
11
I loved strftime method, but... TIL:
I've stopped using datetime.strftime() and just use f-strings. #Python Did you know that you can do this? Instead of >>> somedate.strformat("%Y-%m-%d") do >>> F"{somedate:%Y-%m-%d}"
1
5
Python Tip Time! 🐍 By adding a slash (/) or an asterisk (*) to your function's parameters, you can force the use of positional-only or keyword-only arguments, respectively. Take a look:
2
2
1
10
Python tip🐍 Do you want your objects to be immutable? Since Python 3.7, you can use dataclasses for this! Just use the @dataclass decorator with the "frozen" keyword argument set to True.
1
6
A very easy to understand explanation about the Descriptor Protocol by Josue!
You know what descriptors are in Python? Descriptors are a protocl that let us specify instance attribute's lookup, storage and deletion from the data's POV It's like asking Alexa for the weather. It knows where to get the data, you don't, then you yell it at your spouse
2
Jan keeps putting out there wonderful information! Today he wrote about dunders. Check this thread out!
🤔 Ever heard of Dunder methods (__init__, __repr__, __eq__, ...) in Python? You want to learn more about them? 🧵 This one is for you👇
1
1
3
Python Tip 🐍 Use the __lt__() rich comparison method (i.e: lower than), to allow custom objects to be sorted. . . . *note: It's a good practice to return the NotImplemented object when defining these kind of methods ;) #100DaysOfCode #Python
The first line of code I ever wrote was back in 2011. I remember I used an educational programming language called PSeInt (pseint.sourceforge.net). I can't stress enough how much it helped me back then to understand the basics of programming.
4
The Iterator Protocol is a beautiful adoption of the GoF Iterator Pattern.
1
2
Python tip 🐍 Get the most common element from an iterable (list, tuple, string...) using a Counter object. #100DaysOfCode #Python
1
2
6
The magic behind this is the "most_common()" method of Counter instances. As its docstring states: List the n most common elements and their counts from the most common to the least. If n is None, then list all element counts.
3
I switched from Windows to Ubuntu 90 days ago, and the only thing that I was missing about Windows was MS Office. I had been using LibreOffice since I switched, and the experience wasn't good at all. I installed WPS today, and it's awesome! 🤩 wps.com/
1
5
I've wanted to give @kivyframework a try since a long time. This weekend I started doing a pomodoro app with it. Let's see how it goes!
1
6
So far, I like the concept behind their Kv language, and .kv files. It's nice to declare the GUI layout in a CSS-like way, as opposed to other tools such as PyQT or Tkinter. kivy.org/doc/stable/guide/la…
1