Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for luser
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #288091 |
The problem with `structlog` is it's not build above the existing `logging` infrastructure at all, it's completely separate and (sort of) incompatible. (more) |
— | over 1 year ago |
Comment | Post #288098 |
given there's a record of type `LogRecord` and a record of type `dict`, how would you name variables to distinguish them, if you don't add the type in the var name? (more) |
— | over 1 year ago |
Edit | Post #288099 | Initial revision | — | over 1 year ago |
Question | — |
Is it possible to get the current function in a trace function? I'm trying to subclass `pdb` to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behaved decorator using `@functools.wraps` sets `wrapped` attribute on the wrapper to point to the decorated... (more) |
— | over 1 year ago |
Suggested Edit | Post #286006 |
Suggested edit: (more) |
declined | over 2 years ago |
Edit | Post #286161 | Initial revision | — | over 2 years ago |
Answer | — |
A: A class to access dicts using attribute syntax 1. It is useful sometimes, for example consider a program accepting input in the form of templates. An input of `"Value: {obj.field}"` is more readable than `"Value: {obj['field']}"`. - Such an example is an app processing JSON and evaluating expressions on it, like `jq` or a similar Python app,... (more) |
— | over 2 years ago |
Edit | Post #280201 | Initial revision | — | almost 4 years ago |
Question | — |
How to override default string formatter? It is possible to create a new formatter class by subclassing `string.Formatter` class and then to use it like `myformatter.format("{foo:customformat}", foo=foo)`. It's not super-convenient though, and above all, it fails miserably with f-strings, i.e. `f"{foo:customformat}"` won't use my custom form... (more) |
— | almost 4 years ago |
Comment | Post #279304 |
@Hyperlynx it may be kludgy, but you could do `git rebase -i -x "git commit --amend --reset-author" YOUR_REBASE_POINT` (more) |
— | almost 4 years ago |
Comment | Post #279364 |
Circumventing circular imports can be another good reason for imports in functions. (more) |
— | almost 4 years ago |