Timeline for Python equivalent to VB "with" block
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 23, 2014 at 22:10 | comment | added | abarnert |
@CharlesDuffy: Well, I have a second objection: if you're using gettext for l10n and doing the common trick of assigning the gettext wrapper to _, this will break your code. :) Anyway, _ is the idiomatic way to say "I need a variable and I don't care what it's called" as long as neither of those issues is relevant, but you're right that it's worth pointing that "as long as" part, so +1.
|
|
| Jul 23, 2014 at 21:01 | vote | accept | Reinderien | ||
| Jul 23, 2014 at 20:46 | comment | added | Charles Duffy |
The only objection I see to using _ here is that code would behave differently when run at the console, where _ is assigned the result of the last command.
|
|
| Jul 23, 2014 at 20:40 | history | edited | abarnert | CC BY-SA 3.0 |
added 723 characters in body
|
| Jul 23, 2014 at 20:35 | history | answered | abarnert | CC BY-SA 3.0 |