Re: Project naming suggestions?

2008-02-05 Thread Neil Cerutti
):' when the index isn't needed. I'd also like to implement most of the planned Python 3000 changes. Any suggestions? I'm thinking Ophidian, for the snake connection, or, possibly, Circus, from Monty Python's Flying Circus. Given your stated goals, I like Phyton. -- Neil Cerutti [EMAIL PROTECTED

Re: Checking if a variable is a dictionary

2008-03-06 Thread Neil Cerutti
by specifying a protocol that the values in your dict must implement, instead. Protocols are plentiful in Python, perhaps more popular than type hierarchies. -- Neil Cerutti [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking if a variable is a dictionary

2008-03-06 Thread Neil Cerutti
also misnomered as duck-typing (clearly it should be nomed quack-typing). -- Neil Cerutti [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: text adventure game problem

2008-04-11 Thread Neil Cerutti
adventure, Yes. such as so they're not stuck with a quasi hack of a language if they have to do something that doesn't fit the framework anticipated by the language designer. That's not a reason, it's FUD. -- Neil Cerutti [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: text adventure game problem

2008-04-16 Thread Neil Cerutti
On Tue, Apr 15, 2008 at 9:25 AM, Carl Banks [EMAIL PROTECTED] wrote: On Apr 11, 12:08 pm, Neil Cerutti [EMAIL PROTECTED] wrote: such as so they're not stuck with a quasi hack of a language if they have to do something that doesn't fit the framework anticipated by the language

Re: comparing two lists and returning position

2007-06-21 Thread Neil Cerutti
ie: pos = 0, 2, 4 Thanks in advance, -h Come, come! You can try harder than that. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's only one way to do it philosophy isn't good?

2007-06-22 Thread Neil Cerutti
On 2007-06-21, Douglas Alan [EMAIL PROTECTED] wrote: Neil Cerutti [EMAIL PROTECTED] writes: Seriously, maybe Python looks like 'blub' (thanks, Paul Graham), to the skilled Lisp user, but it makes a lot of other languages look like 'blub', too, including, sometimes, Lisp: Lisp has to 'blub

Re: Python's only one way to do it philosophy isn't good?

2007-06-22 Thread Neil Cerutti
On 2007-06-22, Douglas Alan [EMAIL PROTECTED] wrote: Neil Cerutti [EMAIL PROTECTED] writes: That said, I wouldn't give up the summer I spent studying _Simply Scheme_. Sounds like fun. Is this like a kinder, gentler version of SICP? No, it is a prequel. Along with How to Design Programs

Re: I need some cleanings tips and advice.

2007-06-22 Thread Neil Cerutti
about. Then you try to solicit content in a bunch of programming language newsgroups. Wow, that's pretty pathetic, even for a google-groups poster! Maybe they lost the business plan. It's not surprising, since it was probably written on a napkin. -- Neil Cerutti Ask about our plans for owning

Re: Collections of non-arbitrary objects ?

2007-06-25 Thread Neil Cerutti
, Ted, 15 Smedly Rd. last, first, street = x / ', ' Tongue-in-cheekily-yours, -- Neil Cerutti Strangely, in slow motion replay, the ball seemed to hang in the air for even longer. --David Acfield -- http://mail.python.org/mailman/listinfo/python-list

Re: listing all property variables of a class instance

2007-06-25 Thread Neil Cerutti
): print k, v.__doc__ -- Neil Cerutti 22 members were present at the church meeting held at the home of Mrs. Marsha Crutchfield last evening. Mrs. Crutchfield and Mrs. Rankin sang a duet, The Lord Knows Why. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: Too many 'self' in python.That's a big flaw in this language.

2007-06-27 Thread Neil Cerutti
? Try thinking of self. as a notation that provides vital information to you, the programmer. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Reversing a string

2007-06-27 Thread Neil Cerutti
is a great way to learn, but not that useful for solving exercises. ;) -- Neil Cerutti This team is one execution away from being a very good basketball team. --Doc Rivers -- http://mail.python.org/mailman/listinfo/python-list

Re: listing the type of an object

2007-06-28 Thread Neil Cerutti
): #... Using a naming convention for class objects, e.g., camel-case, is a practice very similar to hungarian notation. I would've said something like: start learning the Python community's naming conventions, and use those instead of inventing your own. -- Neil Cerutti It will work out, somehow. That's

Pretty Scheme, ??? Python

2007-07-02 Thread Neil Cerutti
. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Pretty Scheme, ??? Python

2007-07-02 Thread Neil Cerutti
On 2007-07-02, Laurent Pointal [EMAIL PROTECTED] wrote: Neil Cerutti wrote: How can I make the Python more idiomatic Python? Have you taken a look at pyparsing ? Yes, I have it. PyParsing has, well, so many convenience features they seem to shout down whatever the core features are, and I

Re: Pretty Scheme, ??? Python

2007-07-03 Thread Neil Cerutti
On 2007-07-02, Paul McGuire [EMAIL PROTECTED] wrote: On Jul 2, 3:56 pm, Neil Cerutti [EMAIL PROTECTED] wrote: from pyparsing import * It's always good when your messages start like that. ;) Ok, here is the step-by-step, beginning with your posted BNF. (Based on your test cases, I think

Re: what is wrong with that r\

2007-07-03 Thread Neil Cerutti
would escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the string, not as a line continuation. -- Neil Cerutti Ask about our plans for owning your home --sign at mortgage company -- http

Re: Pretty Scheme, ??? Python

2007-07-03 Thread Neil Cerutti
, in __init__ '-': (operator.sub, 'Sub')}[op] KeyError: '' ** op ought to be '+' or '-'. In fact, testing showed than none of the result names for binop are being set correctly. -- Neil Cerutti The word genius isn't applicable

Re: Pretty Scheme, ??? Python

2007-07-03 Thread Neil Cerutti
by the class hierarchy. -- Neil Cerutti I pulled into a lay-by with smoke coming from under the bonnet. I realized the car was on fire so took my dog and smothered it with a blanket. --Insurance Claim Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3.0 or 3000 ....is it worth waiting??? Newbie Question

2007-07-03 Thread Neil Cerutti
On 2007-07-03, Méta-MCI [EMAIL PROTECTED] wrote: Hi! Python 3000 doesn't include many significant changes to the language One exemple : non-Ascii characters in identifiers (= no significatif change?) It is one of not many? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo

Re: what is wrong with that r\

2007-07-04 Thread Neil Cerutti
for a)? Maybe we should remove it in py3k? If the escaped quotes didn't function in raw strings, I'd be unable to construct (with a single notation) a regex that included both kinds of quotes at once. re.compile(r'\) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: what is wrong with that r\

2007-07-04 Thread Neil Cerutti
On 2007-07-04, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-07-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote: If the escaped quotes didn't function in raw strings, I'd be unable to construct (with a single notation) a regex

Re: what is wrong with that r\

2007-07-04 Thread Neil Cerutti
On 2007-07-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote: If the escaped quotes didn't function in raw strings, I'd be unable to construct (with a single notation) a regex that included both kinds of quotes at once

Re: disappearing documentation of `coerce`

2007-07-04 Thread Neil Cerutti
Built-in Functions. Apparently it is no longer needed or useful, but only kept for backward compatibility. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-05 Thread Neil Cerutti
ZeroDivisionError, e: ... e.my_info = Oops! ... raise ... try: ... foo() ... except ZeroDivisionError, e: ... print e.my_info ... Oops! Users could get at the extra info you attached, but it wouldn't be automatically displayed by the interpreter. -- Neil Cerutti Symphonies

Re: The best platform and editor for Python

2007-07-05 Thread Neil Cerutti
? I'm sure I paid for it, but it wasn't willingly... You should count your blessings. At least it doesn't play pinball any more. At least, I hope not. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
(some.csv, rb)) for row in reader: # Add the row to the dictionary In addition to Chris's answer, the csv module can read and write dictionaries directly. Look up csv.DictReader and csv.DictWriter. -- Neil Cerutti In my prime I could have handled Michael Jordan. Of course, he would be only 12

Re: Re-raising exceptions with modified message

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Christoph Zwerschke [EMAIL PROTECTED] wrote: Neil Cerutti wrote: The documentation for BaseException contains something that might be relevant: [...] If more data needs to be attached to the exception, attach it through arbitrary attributes on the instance. All Users

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
arithmetic upon them is unthinkable. I shared your frustration with the csv module docs when I first read them. But happily you can skip them and just read the easily adapted examples (9.1.5 Examples). -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Christoph Zwerschke [EMAIL PROTECTED] wrote: Neil Cerutti wrote: You may need the traceback module to get at the error message, if trying to read e.message can fail. Something like this mess here: ;) ... except Exception, e: etype, evalue, etb = sys.exc_info

Re: Re-raising exceptions with modified message

2007-07-06 Thread Neil Cerutti
example (although it didn't solve Chris's problem). -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: The best platform and editor for Python

2007-07-06 Thread Neil Cerutti
EXIST!!! A ridiculous claim to be sure, but we'd better let Herr Schluehr know that in no uncertain terms... Wow! That explains why I had so much trouble eating me Wheaties this morning. Can I still post messages if I don't exist? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-05, John Machin [EMAIL PROTECTED] wrote: On Jul 6, 5:31 am, Neil Cerutti [EMAIL PROTECTED] wrote: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-06, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-07-05, John Machin [EMAIL PROTECTED] wrote: On Jul 6, 5:31 am, Neil Cerutti [EMAIL PROTECTED] wrote: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about

Re: variable naming query

2007-07-13 Thread Neil Cerutti
. Further, from the _Python Tutorial (9.6) Private Variables_: (Buglet: derivation of a class with the same name as the base class makes use of private variables of the base class possible.) In other words, it's a misfeature that's best avoided. -- Neil Cerutti -- http://mail.python.org

Re: Can a low-level programmer learn OOP?

2007-07-13 Thread Neil Cerutti
design your program as a state machine. Wouldn't it be easier to implement in a (hypothetical) state-machine-based programming language than in a procedural one? I think John was insinuating that a state-machine is more like an object than it is like a procedure. -- Neil Cerutti -- http

Re: Can a low-level programmer learn OOP?

2007-07-13 Thread Neil Cerutti
for the intersting info. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Private functions and inheritance

2007-07-16 Thread Neil Cerutti
). -- Neil Cerutti The doctors X-rayed my head and found nothing. --Dizzy Dean -- http://mail.python.org/mailman/listinfo/python-list

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Neil Cerutti
to integer is the only support. You can do: d = int(s, base). but not: s = str(d, base) The % format operator can do hex and octal, I believe. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementaion of random.shuffle

2007-07-19 Thread Neil Cerutti
a microwave oven? ... What the!?!? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-20 Thread Neil Cerutti
really want. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Where do they tech Python officialy ?

2007-07-24 Thread Neil Cerutti
online lectures, which helps make up for its non-programmer slant. http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-lectures/ -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures / Blocks in Python

2007-07-24 Thread Neil Cerutti
simple statements, rather than promoting the use of nameless functions. Ruby's some_list.each do |item| puts item end if I understood it correctly, In Python would be: for item in some_list: print item That works for any object that supports the iterator protocol. -- Neil Cerutti

Re: classmethod staticmethod

2007-07-24 Thread Neil Cerutti
or MyClass.class_list. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Neil Cerutti
means I'd be forced to parse the string myself). Does anyone know of a way I can make it use the string? Thanks. Consult the documentation about time.strptime (to start) and then datetime.strptime (which refers back to the time.strptime docs, in a rather unfortunate manner). -- Neil Cerutti

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Ben Finney [EMAIL PROTECTED] wrote: Neil Cerutti [EMAIL PROTECTED] writes: On 2007-07-24, Robert Dailey [EMAIL PROTECTED] wrote: Hi, I have a string in the following format: 00:00:25.886411 I would like to pass this string into the datetime.time() class and have

Re: classmethod staticmethod

2007-07-24 Thread Neil Cerutti
insight, if it turns out that it matters. Preferably, the user of a class doesn't have to really think about it much. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: classmethod staticmethod

2007-07-25 Thread Neil Cerutti
On 2007-07-25, Alex Popescu [EMAIL PROTECTED] wrote: Neil Cerutti [EMAIL PROTECTED] wrote in news:eRwpi.36813$G23.28496 @newsreading01.news.tds.net: On 2007-07-25, Alex Popescu [EMAIL PROTECTED] wrote: As a matter of style, how do you figure out that class_list is a class attribute

Re: Flatten a list/tuple and Call a function with tuples

2007-07-25 Thread Neil Cerutti
): return flatten(obj[0]) else: return [obj[0]] else: return [obj[0]] + flatten(obj[1:]) x = [1, 2, (3, 4)] y = (1, 2, [3, 4]) z = It even works with strings! d = {foo: bar, baz: bat} e = [[1], 2, 3, , 4] f = [1, 2, 3, 4, []] -- Neil Cerutti -- http

Re: is_iterable function.

2007-07-25 Thread Neil Cerutti
On 2007-07-25, Carsten Haese [EMAIL PROTECTED] wrote: On Wed, 2007-07-25 at 19:26 +, Neil Cerutti wrote: Speaking of the iter builtin function, is there an example of the use of the optional sentinel object somewhere I could see? Example 1: If you use a DB-API module that doesn't support

Re: is_iterable function.

2007-07-25 Thread Neil Cerutti
: try: for it in flattened(item): yield func(it) except TypeError: yield func(item) I'd be more confortable excepting some sort of IterationError (or using an is_iterable function, of course). I guess there's always itertools. ;) -- Neil Cerutti -- http://mail.python.org

Re: is_iterable function.

2007-07-25 Thread Neil Cerutti
'__iter__' in dir(thing) So then: def is_iterable(thing): return '__iter__' in dir(thing) or '__getitem__' in dir(thing) Speaking of the iter builtin function, is there an example of the use of the optional sentinel object somewhere I could see? -- Neil Cerutti -- http://mail.python.org/mailman

Re: is_iterable function.

2007-07-26 Thread Neil Cerutti
to catch a TypeError exception when one might be thrown by some other code. I agree with your opinion that it's a design flaw, and most of my problems with the code were caused by that flaw. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: is_iterable function.

2007-07-26 Thread Neil Cerutti
: yield item else: yield func(item) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: first, second, etc line of text file

2007-07-26 Thread Neil Cerutti
): while self.upto = n: line = self.fileobj.readline() if line == : break self.lines.append(line) self.upto += 1 def __getitem__(self, n): self._readupto(n) return self.lines[n] -- Neil Cerutti Eddie Robinson

Re: pyparser and recursion problem

2007-07-26 Thread Neil Cerutti
. On the other hand, since you got it working without pyparsing, probably you're problem doesn't need pyparsing. Hopefully I'll have time to help you a bit more later, or Paul MaGuire will swoop down in his pyparsing powered super-suit. ;) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python

Re: is_iterable function.

2007-07-26 Thread Neil Cerutti
On 2007-07-26, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 26 Jul 2007 15:02:39 +, Neil Cerutti wrote: Based on the discussions in this thread (thanks all for your thoughts), I'm settling for: def is_iterable(obj): try: iter(obj).next() return True except

Re: Flatten a list/tuple and Call a function with tuples

2007-07-25 Thread Neil Cerutti
On 2007-07-25, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-07-25, Jeff [EMAIL PROTECTED] wrote: Here's a quick flatten() function: def flatten(obj): if type(obj) not in (list, tuple, str): raise TypeError(String, list, or tuple expected in flatten().) if len(obj) == 1

is_iterable function.

2007-07-25 Thread Neil Cerutti
def is_iterable(obj): try: iter(obj) return True except TypeError: return False Is there a better way? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: vs !=

2007-07-27 Thread Neil Cerutti
On 2007-07-27, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I believe Guido doesn't like '' and decided to enforce != instead. Guess it's his language :). I like 'not ==', cf 'not in'. Sadly it's a syntax error. However, as a language designer, I'm not Guido. -- Neil Cerutti I don't know what

Re: adding a docstring to an instancemethod

2007-07-27 Thread Neil Cerutti
On 2007-07-27, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 26 Jul 2007 14:48:12 -0300, jelle [EMAIL PROTECTED] escribió: Hi Gabriella, thanks for pointing me in the right direction: Twice in a week... I'll have to revise my own masculinity... The trumpet shall sound! -- Neil

Re: Where do they tech Python officialy ?

2007-07-28 Thread Neil Cerutti
management. That's a big side-show. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: this must be a stupid question ...

2007-07-28 Thread Neil Cerutti
meaning. It means something in regular expressions, namely, the end of the string/line. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Hex editor display - can this be more pythonic?

2007-07-30 Thread Neil Cerutti
I don't know enough about Windows console programs to understand. -- Neil Cerutti The audience is asked to remain seated until the end of the recession. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
it? If it's already been enabled, no harm will come from the import statement. -- Neil Cerutti Will the highways on the Internet become more few? --George W. Bush -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
On 2007-07-30, André [EMAIL PROTECTED] wrote: On Jul 30, 9:39 am, Neil Cerutti [EMAIL PROTECTED] wrote: I don't understand the qualification, at runtime, you're making. What's wrong with just importing what you want and using it? If it's already been enabled, no harm will come from the import

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing overloaded functions with closures.

2007-07-30 Thread Neil Cerutti
advocating the use of higher-order functions. But Java's verbosity and lack of free functions are the only irritating obstacle to using them just as you would in Python. I'm not sure what the author was getting at, exactly. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
the non-working code by one level, but with a good editor that's a snap. Python will still parse the following lines (it must be valid Python syntax), but the resulting parse tree won't be executed. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Extending doctest

2007-08-01 Thread Neil Cerutti
because it depends on internal details of my implementation. Is there a doctest feature that will allow me to stipulate that one thing in a result is arbitrary, but identical to another thing in that result? -- Neil Cerutti Trespassers will be prosecuted to the full extent of the law --sign

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
On 2007-08-01, Cameron Laird [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-01, beginner [EMAIL PROTECTED] wrote: Thanks everyone for responding. It doesn't look like python has it. I would definitely miss it. As Steve said, the nice

Re: Awkward format string

2007-08-01 Thread Neil Cerutti
for your class may make that problem disappear. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Neil Cerutti
On 2007-08-02, Magnus Lycka [EMAIL PROTECTED] wrote: Neil Cerutti wrote: On 2007-08-01, Cameron Laird [EMAIL PROTECTED] wrote: . I want to re-emphasize the triple-quote it tip mentioned earlier in this thread. I think the original questioner will find this quite satisfying, if I

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Neil Cerutti
), a) True reduce(is_consecutive(0), a + [1,2]) False It's been a while since I had to be in the STL mindset, so I couldn't think of a better example. -- Neil Cerutti This is not a book to be put down lightly. It should be thrown with great force. --Dorothy Parker -- http://mail.python.org/mailman

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Neil Cerutti
On 2007-08-02, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-02, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I don't personally use __call__ methods in my classes, but I have encountered it every now and then here at work in code written by other people. The other day I replaced __call__

Re: i am new to python-Please somebody help

2007-08-02 Thread Neil Cerutti
of it, and with the knowledge that somebody else will feel less flip at the time and probably provide real help. -- Neil Cerutti The pastor will preach his farewell message, after which the choir will sing, Break Forth Into Joy. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient Rank Ordering of Nested Lists

2007-08-03 Thread Neil Cerutti
map(functools.partial(bisect.bisect_left, sortedList), singleList) return map(rankList, nestedList) -- Neil Cerutti Facts are stupid things. --Ronald Reagan -- http://mail.python.org/mailman/listinfo/python-list

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Neil Cerutti
it needing three fewer characters to type? It's a great boon to the authors of auto-indenting text editors. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Neil Cerutti
value for every case. In some languages, it's even of more limited, e.g., C, which can switch on only integers. -- Neil Cerutti Next Sunday Mrs. Vinson will be soloist for the morning service. The pastor will then speak on It's a Terrible Experience. --Church Bulletin Blooper -- http

Re: the one python book

2007-08-04 Thread Neil Cerutti
. With Python, you won't find anything like that. Python is too huge. So get used to the idea of needing several books. ;) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: the one python book

2007-08-04 Thread Neil Cerutti
On 2007-08-04, Michael Tobis [EMAIL PROTECTED] wrote: On Aug 4, 9:32 am, Neil Cerutti [EMAIL PROTECTED] wrot With Python, you won't find anything like that. Python is too huge. That's silly. Python is small in the sense that C is small. What way of measuring makes that true? The Python

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Neil Cerutti
://www.python.org/dev/peps/pep-3105 -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-06, Paul Rubin http wrote: Carsten Haese [EMAIL PROTECTED] writes: For instance, if you never use print statements in your code, you won't notice that print is becoming a function. If you do, you'll have to make appropriate

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
. -- Neil Cerutti The outreach committee has enlisted 25 visitors to make calls on people who are not afflicted with any church. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-06, Lee Fleming [EMAIL PROTECTED] wrote: def f(x, y=None): if y is None: y = [] y.append(x) return y f(f(23)) [23, 42] Sorry. That should've been: f(42, f(23)) [23, 42] -- Neil Cerutti Scouts are saving

Re: Scope question

2007-08-06 Thread Neil Cerutti
a function. It can't be defined at one time, and undefined at another time, as can happen in more full-featured environments. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Lee Fleming [EMAIL PROTECTED] wrote: On Aug 6, 6:25 am, Neil Cerutti [EMAIL PROTECTED] wrote: Because when the function is called, the line if y is None: y = [] is executed, binding a brand new empty list to y. This rebinding happens every time the function is called

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
[] is [] False -- Neil Cerutti 8 new choir robes are currently needed, due to the addition of several new members and to the deterioration of some of the older ones. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: seeking tinter module

2007-08-07 Thread Neil Cerutti
+tinter.pyhl=enct=clnkcd=1gl=us -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: All leading tabs or all leading spaces - why isn't that enforced?

2007-08-07 Thread Neil Cerutti
as indentation characters, but now I can't turn up a link for it... Tabs are going to be banned in the C Style Guide for Python 3000 source code, but they aren't being banned from Python 3000 code. -- Neil Cerutti The concert held in Fellowship Hall was a great success. Special thanks are due

Re: Another question about variable args.

2007-08-07 Thread Neil Cerutti
with calling the function isn't wise, but that's a sketch anyhow. -- Neil Cerutti We couldn't beat... us. We couldn't even beat us. I was trying to think of somebody bad, and I couldn't think of anybody else. Us. --Tim Legler -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub does not replace all occurences

2007-08-07 Thread Neil Cerutti
. If omitted or zero, all occurrences will be replaced. Empty matches for the pattern are replaced only when not adjacent to a previous match, so sub('x*', '-', 'abc') returns '-a-b-c-'. In other words, the fourth argument to sub is count, not a set of re flags. -- Neil Cerutti

Re: Dealing with multiple excel sheets

2007-08-07 Thread Neil Cerutti
On 2007-08-07, Rohan [EMAIL PROTECTED] wrote: I would like to write a script which does the following job. Take column1 and 7 from 10 different excel sheets and pasthe them into a new excel worksheet. Any ideas on how to do it Get the xlrd Python module. It'll come in handy. -- Neil Cerutti

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert [EMAIL PROTECTED] wrote: On Aug 6, 6:49 am, Neil Cerutti [EMAIL PROTECTED] wrote: Incidentally, from the second link I find it shocking that the keyword parameter file shadows a builtin. It seems to endorse a bad practice. I believe that the file builtin has been

Re: Something in the function tutorial confused me.

2007-08-08 Thread Neil Cerutti
, depending on the terminology. I tend to think the world would be a better place if he'd been right. -- Neil Cerutti The church will host an evening of fine dining, superb entertainment, and gracious hostility. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert [EMAIL PROTECTED] wrote: On Aug 8, 2:00 pm, Neil Cerutti [EMAIL PROTECTED] wrote: I thought, in fact, that open was on more shaky ground. ;) yeah, that too ... OK, I had misremembered. The current docs say that open is preferred, and that file should rather

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
the file type itself is getting axed. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Neil Cerutti
(d, Gary, 23) multidict_add(d, Adam, 25) d[Gary] [50, 23] -- Neil Cerutti The choir invites any member of the congregation who enjoys sinning to join the choir. --Church Bulletin Blooper -- http://mail.python.org/mailman/listinfo/python-list

Re: check if regeular expression has results

2007-08-09 Thread Neil Cerutti
? Newgroups are a poor substitute for the docs. For one thing, newsgroups sometimes contain cranky people who say, RTFM! The docs will never do that. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >