Skip to content

Commit 313948b

Browse files
committed
update
1 parent 39673bc commit 313948b

File tree

6 files changed

+167
-334
lines changed

6 files changed

+167
-334
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Make Python even more beautiful :) This package includes implementations that yo
1111
execution_directory C:\Users\sudon\MoreBeautifulPython
1212
library_path C:\Users\sudon\MoreBeautifulPython\src\mbp\core.py
1313
cpu_count 16
14-
version 1.5.99
14+
version 1.6.00
1515
=============================================================================================
1616

1717
### Examples

examples.py

+10-17
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_core(log_path="./examples.log"):
142142
log(run_dir())
143143
log(lib_path())
144144
assert_log(this_dir(), lambda x: x.endswith("MoreBeautifulPython"))
145-
log(this_dir(go_up=1, go_to="AnotherProject/hello.txt"))
145+
log(this_dir(up=1, to="AnotherProject/hello.txt"))
146146
assert_log(dir_basename(dir_of(__file__)), "MoreBeautifulPython")
147147
assert_log(file_basename(__file__), "examples.py")
148148

@@ -213,22 +213,8 @@ def __str__(self):
213213
long_list = [i for i in range(70)]
214214
nested_list = [[[1, 2, 3], [4, 5, 6]]]
215215
multi_lines = "line1\n\t\t- line2\n\t\t- line3\n"
216-
hybrid_list = [
217-
_set,
218-
_tuple,
219-
long_list,
220-
short_list,
221-
{},
222-
[],
223-
(),
224-
"string",
225-
None,
226-
True,
227-
False,
228-
(1, 2, 3),
229-
nested_list,
230-
multi_lines,
231-
]
216+
hybrid_list = [_set, _tuple, long_list, short_list, {}, [], (), "string", None, True, False,
217+
(1, 2, 3), nested_list, multi_lines]
232218
hybrid_dict = {
233219
"hybrid_dict": hybrid_list,
234220
"": "empty key",
@@ -238,6 +224,13 @@ def __str__(self):
238224
}
239225
prints(hybrid_dict)
240226

227+
# merge() is a recursive dict.update()
228+
a = {"a": {"a": 100, "b": [0]}}
229+
b = {"a": {"b": 201, "c": 301}}
230+
c = {"a": {"c": 303}, "c": [1, 2]}
231+
assert_log(merge(a, b, c), {"a": {"a": 100, "b": 201, "c": 303}, "c": [1, 2]})
232+
assert_log(merge(c, b, a), {"a": {"a": 100, "b": [0], "c": 301}, "c": [1, 2]})
233+
241234
# try_f() perform try-except routine and capture the result or error messages in a dictionary
242235
with enclose(fname(try_f)):
243236
prints(try_f(sleep_then_maybe_fail, "abc", fail_p=1))

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pep8]
2+
max-line-length = 120

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="mbp",
5-
version="1.5.99",
5+
version="1.6.00",
66
author="Dongqi Su",
77
description="Make Python even more beautiful :) This package includes implementations that you wish were in the standard library.",
88
long_description=open("README.md").read(),

0 commit comments

Comments
 (0)