Skip to content

Instantly share code, notes, and snippets.

View rmariano's full-sized avatar
😀
Technically fearless; Exemplary practitioner.

Mariano Anaya rmariano

😀
Technically fearless; Exemplary practitioner.
View GitHub Profile
@rmariano
rmariano / gregorian_easter_gauss.py
Last active August 29, 2015 14:18
Gregorian Easter
#!/usr/bin/env python3
"""
Sunday 05 April, 2015 - Buenos Aires, Argentina
Python 3.4
Computes the date for the Gregorian Easter by using
Gauss's formula.
"""
from datetime import date
@rmariano
rmariano / ShellScripting.md
Last active August 29, 2015 14:15
Shell scripting

A collection of shell scripts for common repetitive tasks, that might come in handy.

@rmariano
rmariano / function_parameters.md
Last active June 22, 2017 10:15
Pass default mutable arguments in Python

License

Python - How to pass empty lists as default argument

On this gist I would like to point out an aspect of Python that might present some issues if it is not implemented correctly.

Suppose we have a function and we need to define that some of its parameters take an empty list as a default argument. Something like the following, for example, might be a typical implementation: