question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support recursive munching

See original GitHub issue
from munch import Munch

d = {'hello_world': {'cooldown': 30,
                 'items_per_replica': 3,
                 'replicas': {'max': 6, 'min': 3}},
 }
m = Munch(d)
m.hello_world.replicas.min
Traceback (most recent call last):
  File "test.py", line 8, in <module>
    m.hello_world.replicas.min
AttributeError: 'dict' object has no attribute 'replicas'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
vmalloccommented, Jun 4, 2018

@tobiasfielitz also pointing out there isn’t a “clear cut” correct behavior here… For example, in this example the user will not expect munch to convert recursively:

extra_data = {'some': 'extra data'}
user_data = Munch({
    'user_age': 20,
    'user_name': 'user',
    'extra_data': extra_data,
    })
extra_data['additional_key'] = 'value'
1reaction
vmalloccommented, Jun 4, 2018

The original implementation didn’t support it, and since this is a project with very high exposure (being used in many projects as a very basic utility) I’m quite hesitant to break backwards compatibility here…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Munch! Cycles in Linked Lists Binary Trees and Search Trees
The game of Munch! (and a recursive solution). • Data structures: • Cycles in linked (and regular) lists. • Finding cycles in linked...
Read more >
print 1 to 10 recursive in python - YouTube
Code in Python to print 1 to 10 recursively. Support this channel, become a ... Lunch munch with Abida. Lunch munch with Abida....
Read more >
Parsing Expression GLL - arXiv
Abstract. This paper presents an extension of the GLL parsing algorithm for context-free grammars which also supports parsing expression ...
Read more >
Recursive Descent Parsing
-- some :: Parser a -> Parser [a] -- 1 or more times, maximum munch, collect the answers into a list. -- Can...
Read more >
Efficient Deconstruction with Typed Pointer Reversal (abstract)
learning to implement simple recursive data structures such ... Appendix B. Since Rust does not support tail recursion, the.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found