From e7970eb74a25efbd0523c198354246d53674c8ce Mon Sep 17 00:00:00 2001 From: Alexander Tischenko Date: Sat, 18 Apr 2020 00:21:24 +0300 Subject: [PATCH 1/2] Update README.md Due to unavailability of CI server remove images temporary --- README.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/README.md b/README.md index c0f3e9eef..11e0fd9ce 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,6 @@ # Downloads [![Downloads](https://pepy.tech/badge/pony)](https://pepy.tech/project/pony) [![Downloads](https://pepy.tech/badge/pony/month)](https://pepy.tech/project/pony/month) [![Downloads](https://pepy.tech/badge/pony/week)](https://pepy.tech/project/pony/week) -# Tests - -#### PostgreSQL -Python 2 - - -Python 3 - - - -#### SQLite -Python 2 - - -Python 3 - - - -#### CockroachDB -Python 2 - - -Python 3 - - - Pony Object-Relational Mapper ============================= From 675a7300b54a2bbf9e37d76130edd5225a441875 Mon Sep 17 00:00:00 2001 From: SergBobrovsky Date: Wed, 22 Apr 2020 14:06:18 +0300 Subject: [PATCH 2/2] refactor flatten always faster (multiplicity depend on tree depth) --- pony/thirdparty/compiler/ast.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pony/thirdparty/compiler/ast.py b/pony/thirdparty/compiler/ast.py index e5596d4b6..9a17fea4b 100644 --- a/pony/thirdparty/compiler/ast.py +++ b/pony/thirdparty/compiler/ast.py @@ -8,14 +8,15 @@ from .consts import CO_VARARGS, CO_VARKEYWORDS def flatten(seq): + def helper(push, _seq): + for el in _seq: + if type(el) in (tuple, list): + helper(push, el) + else: + push(el) + l = [] - for elt in seq: - t = type(elt) - if t is tuple or t is list: - for elt2 in flatten(elt): - l.append(elt2) - else: - l.append(elt) + helper(l.append, seq) return l def flatten_nodes(seq):