Box: Python dictionaries with recursive dot notation access
1–10 of 124 posts
Re: Box: Python dictionaries with recursive dot notation access
#2Re: Box: Python dictionaries with recursive dot notation access
#3Re: Box: Python dictionaries with recursive dot notation access
#4How is this different from addict? https://github.com/mewwts/addict
Re: Box: Python dictionaries with recursive dot notation access
#5How is the performance on this for very large dictionaries vs. standard python dictionary lookups?
Re: Box: Python dictionaries with recursive dot notation access
#6Can you use 'self' as a key?
Ive used a class to provide this kind of dot notation fererencing of hierarchical data. If you could enclose the keys in quotes I might feel better about it but that's probably not possible.
Re: Box: Python dictionaries with recursive dot notation access
#7* De/serializes JSON and YAML
* De/mangles, de/encodes keys
* Provides automatic, expensive hashcode
* Blacklists/transforms a bunch of likely keys because they conflict with reserved words
* Overlays attrs (__box_heritage)
* All in pretty complex code that obfuscates what you're really doing (especially to a maintainer)
For the ability to avoid importing json/PyYAML and use clear key lookups? The author must really like JavaScript syntax, or something, because I'm not seeing the point in this layer at all. It's the sort of library that you discover your inherited codebase is using, and just say, "fuckfuckfuck...", because it implies that the author cares more about pushing round pegs into square holes than writing the freaking application code; it reeks of inexperience.
Re: Box: Python dictionaries with recursive dot notation access
#8A single class that: * De/serializes JSON and YAML * De/mangles, de/encodes keys * Provides automatic, expensive hashcode * Blacklists/transforms a bunch of likely keys because they conflict with reserved words * Overlays attrs (__box_heritage) * All in pretty complex code that obfuscates what you're really doing (especially to a maintainer) For the ability to avoid importing json/PyYAML and use clear key lookups? Th…
I think the advantage over json/PyYAML is not having to supply conversion functions for Decimal, datetime, or user defined datatypes.
Re: Box: Python dictionaries with recursive dot notation access
#9A single class that: * De/serializes JSON and YAML * De/mangles, de/encodes keys * Provides automatic, expensive hashcode * Blacklists/transforms a bunch of likely keys because they conflict with reserved words * Overlays attrs (__box_heritage) * All in pretty complex code that obfuscates what you're really doing (especially to a maintainer) For the ability to avoid importing json/PyYAML and use clear key lookups? Th…
> For the ability to avoid importing json/PyYAML and use clear key lookups? I think the advantage over json/PyYAML is not having to supply conversion functions for Decimal, datetime, or user defined datatypes.
Re: Box: Python dictionaries with recursive dot notation access
#10 class Obj():
def __init__(self, d):
self.__dict__ = d
d = Obj({
'a': 1,
'b': 2,
})
print(d.a)