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.
Karl Knechtel
A quiet enigma. We don't know anything about Karl Knechtel yet.
Posts
When I have tried to read technical explanations of the syntax rules for programming languages, and when I am trying to decipher error messages, I often encounter the terms expression and statement...
4 answers · posted 2mo ago by Karl Knechtel · last activity 2mo ago by Dirk Herrmann
Before attempting this, make sure it makes sense in context. In a few particular situations, it would be better to take a different approach rather than using the normal tools for composing or f...
posted 2mo ago by Karl Knechtel · edited 2mo ago by Karl Knechtel
Would it discourage others from posting answers, if they saw that a question had an answer with a "works for me" indication applied immediately? (More so than just seeing an immediate, comprehensiv...
3 answers · posted 2mo ago by Karl Knechtel · last activity 24d ago by matthewsnyder
Import modules rather than names first to avoid a circular reference in the import statements; then use forward declarations, as before, to avoid a circular reference in the type annotations - like...
posted 1mo ago by Karl Knechtel · edited 1mo ago by Karl Knechtel
I want to write one or more self-answered Q&As on the topic of text encoding in Python, to serve as canonicals and preempt future lower-quality questions. I can think of the following things th...
3 answers · posted 1mo ago by Karl Knechtel · last activity 1mo ago by Karl Knechtel
Consider this code example: def example(param=[]): param.append('value') print(param) When example is repeatedly called with an existing list, it repeatedly appends to the list, as ...
3 answers · posted 11d ago by Karl Knechtel · last activity 11d ago by Karl Knechtel
I think the framing of this question (and the prior discussion) is wrong, and I think that conditions have evolved since it was originally asked - in particular, we can now see how articles have tu...
posted 2mo ago by Karl Knechtel · edited 2mo ago by Karl Knechtel
So far, existing Meta discussion seems to have at least hinted at the possibility of using separate categories here: To shuffle closed questions out of the way (globally for Codidact) (also) Fo...
1 answer · posted 25d ago by Karl Knechtel · last activity 24d ago by Lundin
Never Too Late Due to, shall we say, recent AI-related hallucinations, pretty much everything that was possible PR-wise in 2019 is possible for this site again. People are leaving Stack Overflow a...
posted 2mo ago by Karl Knechtel
Terminology "Mutable default argument" means exactly what the individual words would suggest: it's an argument which is supplied as the default value for that parameter, which also is mutable. To ...
posted 11d ago by Karl Knechtel · edited 11d ago by Karl Knechtel
Using the write method The write method of a file offers a much more limited interface. It only accepts one argument - a string, for a file opened in text mode - and outputs just what it's given. ...
posted 2mo ago by Karl Knechtel · edited 2mo ago by Karl Knechtel
Use at to schedule the command, using subprocess from Python to invoke at. It doesn't even require shell=True. For example: import shlex, subprocess subprocess.run( # `at` command to run n...
posted 1mo ago by Karl Knechtel · edited 1mo ago by Karl Knechtel
As the author, this is my defense. Design and modeling are on-topic The site topicality documentation explicitly includes "Software design, architecture, or modeling" as on topic. There doesn't s...
posted 16d ago by Karl Knechtel
Workarounds Avoiding mutation Because problems are only caused by actually mutating the default argument, the simplest way to avoid problems is to... not do that. Pythonic code obeys command-quer...
posted 11d ago by Karl Knechtel
Possible justifications It may make sense to use a mutable default argument in the following situations: For simplicity Consider for example an argument that should be some kind of mapping, wher...
posted 11d ago by Karl Knechtel

Reputation | 754 | |
Number of top-level posts | 10 | |
Number of answers | 17 | |
Sum of received votes (up minus down) | 98 | |
Number of edits made | 37 |
Earned Abilities
Statistics
Posts | ||
---|---|---|
Count | 27 | |
Questions | 10 | |
Answers | 17 | |
Articles | 0 |
Votes cast | ||
---|---|---|
Count | 89 |
Flags raised | ||
---|---|---|
Count | 0 |