Skip to content

Instantly share code, notes, and snippets.

@natesilva
natesilva / gist:783687
Created January 17, 2011 23:20
Find command shown as Stack Overflow answer doesn’t work
### See http://j.mp/ffN320
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
$ mkdir mydir
$ cd mydir
$ touch test.h test.cpp
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' WinUnit - Maria Blees (maria.blees@microsoft.com)
'
' [ With modifications by Nate Silva to fix "Current function is not a WinUnit
' test (BEGIN_TEST)" - see http://goo.gl/Znfb ]
'
' This module contains macros for running tests.
'
' In order to use these, make sure that the variable
' WinUnitPath in the _Variables module is set to where
# Example showing how Python default argument handling causes a bug
# when using the ReportLab library for Python. Tested against
# ReportLab 2.3.
#
# See http://gist.github.com/246507 for a generic Python example.
from reportlab.platypus import *
def main():
# Example showing how a subtlety in the way Python handles default
# arguments can cause a bug.
class C(object):
def __init__(self, list1=[], list2=None):
# Wrong: if the list1 default argument of [] is used, that
# default will be *shared* among all instances of the class.
# If it is later modified, other instances can unexpectedly
# inherit the modifications.
self.list1 = list1