Inspired by the Python community, we hope to foster a strong, supportive, and proficient Python community in the Edmonton area.
The Edmonton Python User Group
Anatomy of an Open Source Python Project: From Idea to World Domination!
by Chris Want
Language Fundamentals - Python Types
by Dustin Grue
May 9-17, Cleveland, OH
October 14-19, San Diego, CA
NEXT MEETUP ON JUNE 11TH
- No Major Releases to speak of.
- The Organic Box is hiring a designer!
(ask me about it here or on slack)
- Fujitsu is hiring devops people and .net developers!
(ask me about it here or both "Michael Dunham" on slack)
- Export Data from PDFs with Python
- Pure Python vs Numpy vs TensorFlow (Benchmarking)
Python Tip: Function Argument Defaults
A common Mistake in python is defining the default of an optional argument in the function declaration.
def all_kitten_names(names=): names.append("Ghost") return names
>>> all_kitten_names() ['Ghost'] >>> all_kitten_names() ['Ghost', 'Ghost'] >>> all_kitten_names() ['Ghost', 'Ghost', 'Ghost']
def all_kitten_names(names=None): if names is None: names =  names.append("Gambit") return names
>>> all_kitten_names() ['Gambit'] >>> all_kitten_names() ['Gambit'] >>> all_kitten_names() ['Gambit']
The Reason this happens is that the default value for a function is only evaluated once. This problem arises when you don't give arguments, so do it the right way!