Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Elmar Zander ezander

🏠
Working from home
View GitHub Profile
@ezander
ezander / gist:5108122
Created Mar 7, 2013
c++ class layout plain
View gist:5108122
#include <iostream>
using namespace std;
class A {
public:
int x;
void f() {};
};
@ezander
ezander / gist:1234618
Created Sep 22, 2011
decorator with change of docstring
View gist:1234618
import functools
import unittest
from pydoc import render_doc
def returns(t):
def checktype(func):
def checked_func(*args, **kwargs):
rval = func(*args, **kwargs)
if not isinstance(rval, t):
raise TypeError("Return type is not of type: int but of type "
You can’t perform that action at this time.