Skip to content

Instantly share code, notes, and snippets.

@vovanz
vovanz / dict_merge.py
Created October 3, 2017 18:23 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
import webbrowser
def google_it(e):
url = r'https://www.google.ru/#q=' + e.__class__.__name__ + ':' + str(e) + '+python'
webbrowser.open(url)
def google_it_for_me(f):
def wrapper(*args, **kwargs):
struct point {
double x, y;
point() {
x=0;
y=0;
}
point(double a, double b) {
x=a;
y=b;
}