Re: *** glibc detected *** gdb: malloc(): smallbin double linked list

2010-11-05 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > I imagine that your extension code is trashing the heap, in which case, > valgrind is probably the answer. Something simpler to try first is to run the code with the MALLOC_CHECK_ environment variable set to 2 or 3. That might give a few more clues. -- http://mail.p

Re: functions, list, default parameters

2010-11-05 Thread Steven D'Aprano
On Fri, 05 Nov 2010 12:17:00 +, Mark Wooding wrote: >> #1 Most default values are things like True, False, None, integer or >> string literals. Since they're literals, they will never change, so you >> only need to set them once. > > Right; so a half-decent compiler can notice this and optimi

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-06, Steven D'Aprano wrote: > On Thu, 04 Nov 2010 19:37:25 +, Tim Harig wrote: >> Examples of communication channels that mangle white space abound. > Yes. So what? So something which is broken by them is brittle. And in every circumstance *other* than the syntax of Python, specif

Re: How find all childrens values of a nested dictionary, fast!

2010-11-05 Thread John Ladasky
On Nov 4, 10:21 am, de...@web.de (Diez B. Roggisch) wrote: > macm writes: >     for value in d.values(): >         if isinstance(value, dict): I'm not a Python guru, but... do you care that you're breaking duck typing here? I've had other programmers warn me against using isinstance() for this

Re: Exception Handling in Python 3

2010-11-05 Thread John Ladasky
On Oct 29, 8:53 am, rantingrick wrote: > I am the programmer, and when i say to my interpretor "show this > exception instead of that exception" i expect my interpretor to do > exactly as i say or risk total annihilation!! I don't want my > interpreter "interpreting" my intentions and then doing

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Seebs
On 2010-11-06, Philip Semanchuk wrote: > The former refers to something that programmers would use to learn >the language once they've gone through the tutorial a few times. >The latter is great for writing a Python parser but isn't the >friendliest guide to language constructs. That sounds, then

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-06, Steven D'Aprano wrote: > On Fri, 05 Nov 2010 08:17:02 +0530, Rustom Mody wrote: >> However the original question -- mixing tabs and spaces is bad -- has >> got lost in the flames. Do the most die-hard python fanboys deny this? >> And if not is it asking too much (say in python3) t

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Steven D'Aprano
On Fri, 05 Nov 2010 23:21:11 -0400, Philip Semanchuk wrote: > Take the OP's question. How is one supposed to find out about bitwise > operators in Python? AFAICT they're not mentioned in the tutorial, and > neither are decorators, assert(), global, exec, the ternary if > statement, etc. The tutor

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Steven D'Aprano
On Sat, 06 Nov 2010 04:33:25 +, Steven D'Aprano wrote: > As far as the OP's question, I'm kind of surprised that he wasn't told > that Google is his friend. The very first hit for "python caret" answers > his question. If he had spent even five seconds googling, he would have > got his answer.

Re: Compare source code

2010-11-05 Thread Rustom Mody
As for tools' brokeness regarding spaces/tabs/indentation heres a thread on the emacs list wherein emacs dev Stefan Monnier admits to the fact that emacs' handling in this regard is not perfect. http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/1bd0c33a3e755730/89cbd920ee651b5a?q=

Re: Final state of underlying sequence in islice

2010-11-05 Thread Terry Reedy
On 11/5/2010 4:51 PM, Raymond Hettinger wrote: On Nov 5, 1:05 pm, Terry Reedy wrote: Currently, there are no promises or guarantees about the final state of the iterator. I interpret the current doc statement as a promise that becomes ambiguous when step> 1. You may have missed my point.

Re: Final state of underlying sequence in islice

2010-11-05 Thread Shashank Singh
I have created an issue in roundup at http://bugs.python.org/issue10323. I was expecting the discussion to move to that place but since it has not, for the sake of completion I am quoting my response to Raymond that I had posted on roundup. > @Raymond: I don't have a particular use case where I ha

<    1   2