Commands for a breakpoint in .pdbrc

2010-01-05 Thread Pablo Torres N.
27;foo.attr2' and even 'end'. The same happens for the rest of the breakpoints, so I end up with them set but not their commands. What would be the correct way to do this? Is it even possible? Thanks a lot, Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-24 Thread Pablo Torres N.
On Sep 24, 5:51 am, Iain King wrote: > On Sep 23, 7:36 pm, David C Ullrich wrote: > > > > > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > > > >> But you actually want to return twice the value. I don't see how to do >

Re: How to check if any item from a list of strings is in a big string?

2009-07-16 Thread Pablo Torres N.
turn False > ... >> Any ideas how to make that function look nicer? :) > > Change the names. Reverse the order of the arguments. Add a docstring. > Why reverse the order of the arguments? Is there a design principle there? I always make a mess out of the order of my arguments

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Pablo Torres N.
g-Yun "Xavier" Ho, Technical Artist > > Contact Information > Mobile: (+61) 04 3335 4748 > Skype ID: SpaXe85 > Email: cont...@xavierho.com > Website: http://xavierho.com/ > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: can i write a assemly language programs in python

2009-07-09 Thread Pablo Torres N.
te assembly *with* python. > Or how to translate python to assembly. > > As it turns out, CPython translates Python to byte code and has a dis > (assembly) module that produces very nice assembly code ;-) > So that is one answer to his question. > >> You'll need to tell

Re: Best way to add a "position" value to each item in a list

2009-07-09 Thread Pablo Torres N.
nd what you mean by 'page'. Could you tell us about the structure of these dictionaries? > Any way to do that with list comprehension?  Any other good way to do > it besides iterating over the list? > > Thanks > -- > http://mail.python.org/mailman/listinfo/python-list > -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie needs help

2009-07-07 Thread Pablo Torres N.
> nacim Give this one a try too: http://www.mikeash.com/getting_answers.html It doesn't talk down to you...as much :P -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Semi-Newbie needs a little help

2009-07-06 Thread Pablo Torres N.
tion errors and moving your comments above the line they reference will attract more help from others in this list ;-) Also, I'd recommend limiting your line length to 80 chars, since lines are wrapped anyway. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: A Bug By Any Other Name ...

2009-07-06 Thread Pablo Torres N.
 I agree that it would be a good idea to make it an > error, or a warning - "this might not do what you > think it does", or an "are you sure?" exception. > >  :-) > > - Hendrik That would be even harder than adding a line to the docs. Besides, the problem th

Re: How Python Implements "long integer"?

2009-07-05 Thread Pablo Torres N.
reading this file? I mean which function is the >> first? > > I don't really understand the question:  what do you mean by 'first'? > It might help if you tell us what your aims are. I think he means the entry point, problem is that libraries have many. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Pablo Torres N.
t save your student's sanity and stick to good old conditionals :-) As for your initial question, I think, thirty four emails after, that yes, your function is a bit too clever and you should sacrifice some generality in order to make it more readable. -- Pablo Torres N. -- http://mail.p

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Pablo Torres N.
nd would > like to understand the reasoning behind it. > > kj > -- > http://mail.python.org/mailman/listinfo/python-list > But...if no code is generated for assertions on some occasions, then the parameters would go unchecked, potentially breaking your code in said occasions. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C or C++ Functions inside Python script

2009-07-04 Thread Pablo Torres N.
ware development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby. " --- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Pablo Torres N.
the last one. In fact, I'd let them to realize that a function is convenient, and base some of the grading in whether they wrote it or not. Just a thought. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-03 Thread Pablo Torres N.
icial, so it can be judged objectively. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
filter are faster than iterating with the for statement (and also faster than list comprehensions). So here is a rewrite: def split(seq, func=bool): t = filter(func, seq) f = filter(lambda x: not func(x), seq) return list(t), list(f) The lambda thing is kinda ugly, but I can't think of anything else. Also, is it ok to return lists? Py3k saw a lot of APIs changed to return iterables instead of lists, so maybe my function should have 'return t, f' as it's last statement. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
On Jul 2, 9:56 pm, schickb wrote: > I have fairly often found the need to split a sequence into two groups > based on a function result. Much like the existing filter function, > but returning a tuple of true, false sequences. In Python, something > like: > > def split(seq, func=None): >     if fu

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
ds like it belongs to the python-ideas list. I suggest posting there for better feedback, since the core developers check that list more often than this one. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem installing python 2.6.2 from tarball

2009-07-01 Thread Pablo Torres N.
list from a while ago: http://mail.python.org/pipermail/python-list/2004-December/296269.html I have followed it and it worked. Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list