eeyyyyyy fellow python spice enjoyers, what would you say is more "readable" / straight-forward for a nested dictionary creation/update scenario?

a = {} b = "pumpkin" c = "spice" if b in a: a[b][c] = True else: a[b] = {c: True}vsa = {} b = "python" c = "spice up ya life" a.update({b: {c: True}})
the second one is definitely less code but I feel like it's... a tich too clever. Or do people often use that second approach? I've classically stuck to the first one but.

Assume it will be read by non-python experts, as well, but that visually things are getting a little cluttered so maybe condensing some things would be nice...

#python #pythonQuestions

What is a decorator in Python?

A decorator is a function that takes another function, adds some extra behavior, and returns a new function. You use it when you want to add common logic, like logging, timing, authentication or validation, without changing the original function code.

#pythoninterview #pythondecorator #pythonjobprep #pythoncodinginterview #pythonpeak #pythonquestions #juniorpython #pythonconcepts #decorators #pythonprogramming

https://www.youtube.com/watch?v=79vsKNpN4QA

What is a decorator in Python? #pythonprogramming

YouTube

anyone have a favorite #python #logging package? loguru looks nice. structlog looks interesting as well. but maybe base logging is the way to go?

#foss #logger #PythonQuestions