[issue35262] There should be a list.get just like dict.get

2018-11-16 Thread Abram Clark
Abram Clark added the comment: There really are valid use cases for this. Would you please refer me to this previous discussion? In a particular small to medium sized Python repository of ~10k lines, list get is used 23 times, whereas other list builtin methods are used far less (for

[issue35262] There should be a list.get just like dict.get

2018-11-15 Thread Abram Clark
New submission from Abram Clark : Just like with dictionaries, it is convenient to index lists without catching exceptions. Adding an import for this most basic functionality is slightly tedious, and I can't imagine it would break anything to add a list.get method. -- mes

[issue17191] pdb list shows unexpected code when stack frame includes a try / finally block

2013-02-12 Thread Abram Clark
New submission from Abram Clark: The list command in pdb shows an unexpected portion of code after an up command enters a try / finally block in the call stack. To reproduce: pdb pdb_list_bug_reproduce.py c up list Expected behavior: Show 11 lines around line 8, "throw_something()&qu