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
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
>
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
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
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
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
> 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
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
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
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
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
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
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
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
icial, so it can be
judged objectively.
--
Pablo Torres N.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
On Aug 20, 4:59 pm, Bert Heymans <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I made a Python cli application for resizing batches of images based
> on the PIL. You can find it herehttp://heymans.org/pyresize.html
>
> It's just an straight forward command line interface application but I
> guess many peopl
On Aug 19, 7:33 pm, Anonymous <[EMAIL PROTECTED]> wrote:
> I have exp with C/C++ (and a few other langs). I want to use Python to
> start doing the ff:
>
> 1). Data Munging (text processing) - instead of Perl
> 2). Automating my build process
> 3). (Possibly) some web data retrieval jobs
>
> Can an
Thanks everyone. Now I see why every row in my grid were actually the
same object.
Pablo
--
http://mail.python.org/mailman/listinfo/python-list
Hi guys!
I am working on Conway's Game of Life right now and I've run into a
little problem.
I represent dead cells with 0s and live ones with 1s. Check this out:
>>> grid = [[0] * 3] * 3
>>> grid
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>> grid[0][0] = 1
[[1, 0,
>
> list.insert returns None. Thus, except in the one-element case, your
> generator is yielding None all the time.
>
Oh god...silly me.
Thank you guys for the help :)
P.S I'm dead stubborn, so here's what I did to fix my code:
def perm(seq):
"Reshuffles the elements of seq in every pos
Just a quick P.S: This WOULD NOT work with strings, because of
seq.insert()
In very other aspect, I'm still lost.
--
http://mail.python.org/mailman/listinfo/python-list
Hey guys!
For the last couple of days, I've been fighting a war against
generators and they've beaten the crap out of me several times. What I
want to do is implement one that yields every possible permutation of
a given sequence (I had lists in mind, but I could swear that this
would work on strin
26 matches
Mail list logo