dschenck / easytree Goto Github PK
View Code? Open in Web Editor NEWA recursive dot-styled defaultdict to read and write deeply-nested trees
Home Page: https://easytree.readthedocs.io
License: MIT License
A recursive dot-styled defaultdict to read and write deeply-nested trees
Home Page: https://easytree.readthedocs.io
License: MIT License
Overwriting to same undefined node with nested context overwrites previous value
import easytree
person = easytree.dict()
with person.address as address:
address.street = "Beta Street"
address.country = "Canada"
# returns {"address": {"country": "Canada"}}
# expected {"address": {"country": "Canada", "street": "Beta Street"}}
person
The classes of easytree.list
and easytree.dict
shadows the built-in functions of list
and dict
. This can pose a problem such as the example below where one cannot use the built-in list
or dict
anymore when using import-from
statements.
from easytree import list, dict
# need to make an easytree list and dict
a = list()
b = dict()
print(type(a), type(b)) # <class 'easytree.types.list'> <class 'easytree.types.dict'>
# now need to make a regular list and dict
c = list()
d = dict()
print(type(c), type(d)) # <class 'easytree.types.list'> <class 'easytree.types.dict'>
# ^ needed default list and dict, not easytree's
To fix this, one possible solution is to capitalize the class names to easytree.List
and easytree.Dict
. However, this would then intefere with the typing module's List
and Dict
, if that's worth considering.
One other possible solution is to rename them to easytree.EasyList
or easytree.EasyDict
or some other variation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.