What I miss from Python in other programming languages Posted late Thursday evening, June 22nd, 2017

Having a way of importing a single class/function into the current file/module:

# ---------- A.py -------------
class MyClass:
    ...

def my_func():
    ...

# ---------- B.py -------------
from A import my_func

my_func()

The language support for named arguments, and variable number of arguments, specially when calling functions with many arguments:

def my_func(a, b, c=2):
    print(a, b, c)

my_func(0, 1, 3)
# 0 1 3

my_func(0, 1)
# 0 1 2

my_func(0, b=2, c=4)
# 0 2 4

my_func(b=2, c=4, a=0)
# 0 2 4

The awareness in the community (and by extension in the documentation and other online resources) about how to handle bytes vs. strings in your program. Precious little other languages take care of talking about this.

The handling of negative indexes for lists, and the range() method for generating sequences. Some other languages have syntax for ranges, but they end up being either more limited, or unfriendly in non-standard situations (I'm looking at you and your handling of negative endpoints in ranges, Elixir.)

Also, IPython, and its automatic module reloading.

Tags: python
Mark Pilgrim Posted Sunday night, October 16th, 2011

Aquí yace la identidad digital de Mark Pilgrim. Parió dos panecillos y una abeja.

Me quedó la inspiración general para el diagramado de este blog, el tipo de letra, y el CSS para las citas. Y un mayor y mejor dominio de Python, de expresiones regulares, y de la importancia de la ley de Postel. Y el recuerdo (y el archivo) de algunas de las mejores rants que he leído.

Y me quedo estupefacto preguntándome qué puede llevar a alguien con el deseo y con el músculo necesarios para crear y mantener adecuadamente su identidad digital, a terminar con ella.

Porque no es el primero. Ya pasó con why the lucky stiff, y casi pasa con Steve Yegge. Y podría decirse que pasó también con Tuomo Valkonen.

Tags: python

Older posts

Python, and the os module
Posted at teatime on Thursday, September 22nd, 2011
safe-extract
Posted Wednesday night, June 15th, 2011
Scientific computing using Python
Posted late Tuesday evening, January 4th, 2011
Python, closures and scopes
Posted late Friday night, November 13th, 2010
Revenge, at last!
Posted Thursday night, February 18th, 2010
Django's mascot
Posted at lunch time on Thursday, July 16th, 2009
speed
Posted at midnight, February 28th, 2009