Plurrrr

Sun 22 Nov 2020

Building Your Color Palette

Ever used one of those fancy color palette generators? You know, the ones where you pick a starting color, tweak some options that probably include some musical jargon like "triad" or "major fourth", and are then bestowed the five perfect color swatches you should use to build your website?

This calculated and scientific approach to picking the perfect color scheme is extremely seductive, but not very useful.

Source: Building Your Color Palette.

How variables are implemented in CPython

Consider a simple assignment statement in Python:

a = b

The meaning of this statement may seem trivial. What we do here is take the value of the name b and assign it to the name a, but do we really? This is an ambiguous explanation that gives rise to a lot of questions:

  • What does it mean for a name to be associated with a value? What is a value?
  • What does CPython do to assign a value to a name? To get the value?
  • Are all variables implemented in the same way?

Today we'll answer these questions and understand how variables, so crucial aspect of a programming language, are implemented in CPython.

Source: Python behind the scenes #5: how variables are implemented in CPython, an article by Victor Skvortsov.