Re: PEP8 compliance and exception messages ?

2010-12-06 Thread Andreas Waldenburger
On Mon, 6 Dec 2010 00:22:49 -0500 Andreas Waldenburger wrote: > On Sun, 5 Dec 2010 19:52:54 -0800 Chris Rebert > wrote: > > > On Sun, Dec 5, 2010 at 7:40 PM, shearichard > > wrote: > > > Hi - PEP8 says lines should not exceed 79 characters in length > > &g

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Andreas Waldenburger
On Sun, 5 Dec 2010 19:52:54 -0800 Chris Rebert wrote: > On Sun, Dec 5, 2010 at 7:40 PM, shearichard > wrote: > > Hi - PEP8 says lines should not exceed 79 characters in length > > ( http://www.python.org/dev/peps/pep-0008/ ). > > > > So if you've got some code that looks like this : > > > > rais

Re: Python recursively __getattribute__

2010-11-22 Thread Andreas Waldenburger
On Mon, 22 Nov 2010 08:41:49 -0800 (PST) Roman Dolgiy wrote: > On Nov 22, 6:04 pm, Andreas Waldenburger > wrote: > > On Mon, 22 Nov 2010 07:46:47 -0800 (PST) Roman Dolgiy > > wrote: > > > > > Hello, > > > > > I need to implemen

Re: Python recursively __getattribute__

2010-11-22 Thread Andreas Waldenburger
On Mon, 22 Nov 2010 07:46:47 -0800 (PST) Roman Dolgiy wrote: > Hello, > > I need to implement such behavior: > > obj.attr1.attr2.attr3 --> obj.attr1__attr2__attr3 > It looks like I have to override obj's class __getattribute__ and also > use python descriptors somehow. > > Any help will be muc

Re: Scheme as a virtual machine?

2010-11-22 Thread Andreas Waldenburger
On 22 Nov 2010 06:26:34 GMT Steven D'Aprano wrote: > On Sun, 21 Nov 2010 23:57:21 -0500, Steve Holden wrote: > > > Perhaps we could take this thread to alt.small.minded.bickering now? > > Alas, my ISP doesn't carry that newsgroup. Where else can I get my > mindless off-topic bitching if not f

Re: Some syntactic sugar proposals

2010-11-17 Thread Andreas Waldenburger
On Wed, 17 Nov 2010 10:18:51 -0500 Mel wrote: > Christopher wrote: > > >> ? Of course we can write it as > >> t = foo() if pred(foo()) else default_value > >> but here we have 2 foo() calls instead of one. Why can't we write > >> just something like this: > >> t = foo() if pred(it) else default_

Re: [Beginer Question] I heard about python needing somesort of_VariableName_ boiler plate?

2010-11-01 Thread Andreas Waldenburger
On Mon, 1 Nov 2010 18:18:45 + brad...@hotmail.com wrote: > Sorry that is what I mean. What is it for? > Sent wirelessly from my BlackBerry. > >>> andreas.quick_hot_anger = True Braden! Stop Top-Posting already! Please. If your BlackBerry makes this hard, then get another mail client. It get

Re: Discussion board software?

2010-10-28 Thread Andreas Waldenburger
On Fri, 29 Oct 2010 01:28:12 + brad...@hotmail.com wrote: [fixed top posting] > --Original Message-- > From: Gnarlodious > Sender: python-list-bounces+bradenf=hotmail@python.org > To: Python List > Subject: Discussion board software? > Sent: Oct 28, 2010 9:12 PM > > > Is there such

Re: Why "flat is better than nested"?

2010-10-28 Thread Andreas Waldenburger
On Wed, 27 Oct 2010 22:47:35 -0700 (PDT) alex23 wrote: > On Oct 27, 7:58 pm, Robin Becker wrote: > > >> "I know that that that that that boy said is wrong!". > > > > well they say nested is hard. How about this break down > > > > I know that X that a boy said is wrong. (any boy) > > I know that

Re: functions, list, default parameters

2010-10-21 Thread Andreas Waldenburger
On Thu, 21 Oct 2010 19:53:53 -0700 John Nagle wrote: > On 10/21/2010 2:51 PM, Chris Rebert wrote: > > On Thu, Oct 21, 2010 at 2:36 PM, Sean Choi wrote: > >> I found two similar questions in the mailing list, but I didn't > >> understand the explanations. > >> I ran this code on Ubuntu 10.04 with

Re: Classes in a class: how to access variables from one in another

2010-10-20 Thread Andreas Waldenburger
On 18 Oct 2010 22:29:27 GMT Steven D'Aprano wrote: > On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote: > > > Also, Python's scoping rules, particularly for class-level scopes, > > don't work the way programmers from languages where nested classes > > are common would expect: > [snip exampl

Re: Help with paths

2010-10-18 Thread Andreas Waldenburger
On Mon, 18 Oct 2010 17:29:11 -0400 Andreas Waldenburger wrote: > On Mon, 18 Oct 2010 14:24:39 -0700 (PDT) Devin M > wrote: > [snip] > > Maybe os.relpath("..", FilePath) ? Python > 2.6 only. > Gah! I should learn to copy&paste more. Obviously it's t

Re: Help with paths

2010-10-18 Thread Andreas Waldenburger
On Mon, 18 Oct 2010 14:24:39 -0700 (PDT) Devin M wrote: > Hello, I am using os.path to get the absolute paths of a few > directories that some python files are in. > FIlePath = os.path.dirname(os.path.realpath(__file__)) > which returns a path similar to /home/devinm/project/files > Now I want to

Re: Classes in a class: how to access variables from one in another

2010-10-18 Thread Andreas Waldenburger
On Mon, 18 Oct 2010 17:17:52 +0200 Christian Heimes wrote: > [snip] > Don't nest classes. Just don't. This might be a valid and good > approach in some programming languages but it's not Pythonic. Explain! /W -- To reach me via email, replace INVALID with the country code of my home country

Re: parse xml

2010-10-15 Thread Andreas Waldenburger
On Fri, 15 Oct 2010 10:49:18 -0700 (PDT) kostia wrote: > I have xml file: > > > 5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom > from xml.dom.minidom import Node > doc = xml.dom.minidom.parseString("boolean_wi

Re: help!!!

2010-10-11 Thread Andreas Waldenburger
ls wrote: > >>>> > >>>> > >>>>On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger > >>>> wrote: > >>>> > >>>> On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro > >>>>w

Re: help!!!

2010-10-11 Thread Andreas Waldenburger
On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro wrote: > In message , > Emile van Sebille wrote: > > > Oh come now -- isn't being lazy a primary programmer's attribute? > > I wonder if that’s why more men are good at it than women... You may want to think about whether this really was y

Re: question about a program

2010-10-08 Thread Andreas Waldenburger
On Fri, 8 Oct 2010 14:34:21 -0700 Chris Rebert wrote: > On Thu, Oct 7, 2010 at 5:39 PM, Logan Butler > wrote: > > question about an assignment: > > > places("home sweet home is here",' ') > > [4, 10, 15, 18] > > > > this is my code: > > > > def places(x, y): > >    return [x.index(y) for v

Re: question about a program

2010-10-08 Thread Andreas Waldenburger
On Thu, 7 Oct 2010 17:39:51 -0700 (PDT) Logan Butler wrote: > question about an assignment: > > >>> places("home sweet home is here",' ') > [4, 10, 15, 18] > > this is my code: > > def places(x, y): > return [x.index(y) for v in x if (v == y)] > > so far I'm only getting > [4, 4, 4, 4] >

Re: open file on mac

2010-10-08 Thread Andreas Waldenburger
On Fri, 8 Oct 2010 07:16:13 -0700 (PDT) tinauser wrote: > on mac I get an error if i do not give the full path of initfile.py > (commented out in the code above); > on windows i did not have this problem. > Am I missing anything? open("initfile.py") opens initfile.py in the current working direc

Re: Many newbie questions regarding python

2010-10-08 Thread Andreas Waldenburger
On Thu, 7 Oct 2010 18:34:58 -0700 (PDT) alex23 wrote: > On Oct 8, 10:27 am, Steven D'Aprano cybersource.com.au> wrote: > > >     v = [0 for i in range(20)] > > > > Absolutely not. Such a code snippet is very common, in fact I've > > done it myself, but it is a "hammer solution" -- to a small boy

Re: Many newbie questions regarding python

2010-10-07 Thread Andreas Waldenburger
On Fri, 08 Oct 2010 00:46:41 +0100 MRAB wrote: > In other words, don't try to write a C program in Python! Man, I'm good. :D /W -- To reach me via email, replace INVALID with the country code of my home country. But if you spam me, I'll be one sour kraut. -- http://mail.python.org/mailman

Re: Many newbie questions regarding python

2010-10-07 Thread Andreas Waldenburger
On Thu, 07 Oct 2010 20:10:14 -0300 Rogério Brito wrote: > I am used to some languages like C, but I am just a complete newbie > with Python and, while writing some small snippets, I had encountered > some problems, with which I would sincerely appreciate any help, > since I appreciate this langua

Re: if the else short form

2010-10-05 Thread Andreas Waldenburger
On Tue, 05 Oct 2010 18:54:42 +1300 Lawrence D'Oliveiro wrote: > “boolnoob” Bwahahahah! Nice! I'd love to say that I'll add this to my active vocabulary, but I don't think there will be enough opportunities to use it. :-/ /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-

Re: How parametrize classes by class data?

2010-10-04 Thread Andreas Waldenburger
On Mon, 4 Oct 2010 15:59:51 + (UTC) kj wrote: > I want to implement a "class of classes", so that, instead of the > usual: > > spam = MyClass(eggs) > > ...I can write > > spam = MyClass(ham)(eggs) Use a factory function: def MyClass(param): class TemplateClass: # Do stuff wit

Re: if the else short form

2010-10-03 Thread Andreas Waldenburger
On Fri, 1 Oct 2010 00:42:34 -0700 (PDT) "bruno.desthuilli...@gmail.com" wrote: > On 30 sep, 19:22, Andreas Waldenburger > wrote: > > On Thu, 30 Sep 2010 03:42:29 -0700 (PDT) > > > > "bruno.desthuilli...@gmail.com" > > wrote: > > > On 2

Re: if the else short form

2010-09-30 Thread Andreas Waldenburger
On Thu, 30 Sep 2010 03:42:29 -0700 (PDT) "bruno.desthuilli...@gmail.com" wrote: > On 29 sep, 19:20, Seebs wrote: > > On 2010-09-29, Tracubik wrote: > > > button = gtk.Button(("False,", "True,")[fill==True]) > > > Oh, what a nasty idiom. > > > > Well, it's not very different from dict-based di

Re: install 3.1

2010-09-30 Thread Andreas Waldenburger
On Thu, 30 Sep 2010 09:39:08 -0700 Chris Rebert wrote: > On Thu, Sep 30, 2010 at 2:57 AM, ronald brown > wrote: > print 'Hello, world!' > > SyntaxError: invalid syntax > > > Installed 3 times. Used uninstall in program files and control > > panel. Followed directions on video for 3.1 >

Re: if the else short form

2010-09-29 Thread Andreas Waldenburger
On Wed, 29 Sep 2010 08:53:17 -0400 Philip Semanchuk wrote: > Does Python make any guarantee that int(True) == 1 and int(False) == > 0 will always hold, or are their values an implementation detail? > Bool

Re: Reoedering indexes in list of list

2010-09-29 Thread Andreas Waldenburger
On Tue, 28 Sep 2010 11:55:18 -0700 (PDT) Toto wrote: > Hello, > > I have a list of list > assume myList[x][y] is integer > I would like to create an alias to that list which I could call this > way: > alias[y][x] returns myList[x][y] > > how can I do that ? (python 2.6) > > (I have a feeling I

Re: Introducing Kids to Programming: 2 or 3?

2010-09-27 Thread Andreas Waldenburger
On Mon, 27 Sep 2010 17:48:06 +0200 Marco Gallotta wrote: > Since these are kids, we feel the nice changes in 3 such as removing > integer division will help in teaching. It will also remove confusion > when they go to download Python and grab the latest version. Since > they're just starting, cha

Re: Too much code - slicing

2010-09-23 Thread Andreas Waldenburger
On Wed, 22 Sep 2010 20:45:55 -0500 John Bokma wrote: > What surprises me is that this is still discussed. It's like argueing > about significant whitespace. :-) Which is evil! /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: Too much code - slicing

2010-09-23 Thread Andreas Waldenburger
On 23 Sep 2010 00:33:28 GMT Steven D'Aprano wrote: > On Tue, 21 Sep 2010 12:26:29 -0400, Andreas Waldenburger wrote: > > > On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks > > wrote: > > > >> On Sep 17, 1:01 pm, Andreas Waldenburger > >> wrot

Re: Too much code - slicing

2010-09-23 Thread Andreas Waldenburger
On 23 Sep 2010 03:54:52 GMT Seebs wrote: > On 2010-09-23, Steven D'Aprano > wrote: > [snip] > > I don't see anyone bitching about: > > > for x in seq: > > if x: > > f(x) > > > vs > > > [f(x) for x in seq if x] > > In my case, that's because I only ran into that syntax about an h

Re: Too much code - slicing

2010-09-21 Thread Andreas Waldenburger
On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks wrote: > On Sep 17, 1:01 pm, Andreas Waldenburger > wrote: > > On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote: > > > > > I also like this construct that works, I think, since 2.6: > > > > > code = dir[

Re: Too much code - slicing

2010-09-17 Thread Andreas Waldenburger
On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote: > I also like this construct that works, I think, since 2.6: > > code = dir[int(num):] if side == 'l' else dir[:-1*int(num)] > I wonder when this construct will finally start to look good. /W -- INVALID? DE! -- http://mail.python.org/mailman/li

Re: Slice a list of lists?

2010-09-08 Thread Andreas Waldenburger
On Wed, 8 Sep 2010 15:23:35 -0500 Jonno wrote: > On Wed, Sep 8, 2010 at 3:18 PM, Jonno wrote: > [snip] > > Now if I want to select the first item in every 2nd item of list a > > (ie: [1,7]) can I use ::2 anywhere or do I need to create a list of > > indices to use in a more complex for loop? > >

Re: Slice a list of lists?

2010-09-08 Thread Andreas Waldenburger
On Wed, 8 Sep 2010 15:11:51 -0400 Benjamin Kaplan wrote: > There is no simple way to get [1,4,7] because it is just a list of > lists and not an actual matrix. You have to extract the elements > yourself. > > col = [] > for row in a: > col.append(row[0]) > > > You can do this in one line u

Re: Slice a list of lists?

2010-09-08 Thread Andreas Waldenburger
Let me rephrase what I wrote a bit. On Wed, 8 Sep 2010 15:08:11 -0400 Andreas Waldenburger wrote: > > a[0][:]=[1,2,3] > Here you're making a list of all elements of the first element of a. > That is, you're making a copy of the first element of a. > > a[:][

Re: Slice a list of lists?

2010-09-08 Thread Andreas Waldenburger
On Wed, 8 Sep 2010 13:55:50 -0500 Jonno wrote: > I know that I can index into a list of lists like this: > a=[[1,2,3],[4,5,6],[7,8,9]] > a[0][2]=3 > a[2][0]=7 > > but when I try to use fancy indexing to select the first item in each > list I get: Let me write out in words what you're doing, and

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Andreas Waldenburger
On Fri, 16 Jul 2010 17:26:05 +0200 Daniel Fetchinson wrote: > >>> I'm pleased to announce the release of inflect.py v0.1.8, a > >>> module that correctly generates: > >>> > >>> * the plural of singular nouns and verbs > >>> * the singular of plural nouns > >>> * ordinals > >>> * indefinite articl

Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread Andreas Waldenburger
On Fri, 16 Jul 2010 06:29:46 -0700 (PDT) ernest wrote: > On 15 Jul, 18:45, kj wrote: > > This is a question _for Emacs users_ (the rest of you, go away :) > >  ). > > > > How do you do Python code-folding in Emacs? > > > > Thanks! > > > > ~K > > I tried the outline-mode and it seemed to work. I

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Andreas Waldenburger
On Sun, 11 Jul 2010 15:46:40 +0200 News123 wrote: > Andre Alexander Bell wrote: > > On 07/11/2010 10:30 AM, rantingrick wrote: > > >>> So, it is not a disadvantage that the functions you listed above > >>> are named in this way. In the contrary, it is an advantage, as it > >>> keeps newcomers fr

Re: Hello

2010-07-10 Thread Andreas Waldenburger
On Fri, 9 Jul 2010 16:49:20 + (UTC) Grant Edwards wrote: > On 2010-07-09, Dani Valverde wrote: > > > I am new to python and pretty new to programming (I have some > > expertise wit R statistical programming language). I am just > > starting, so my questions may be a little bit stupid. Can a

Re: Solutions for hand injury from computer use

2010-07-01 Thread Andreas Waldenburger
On Thu, 01 Jul 2010 10:09:30 -0700 Emile van Sebille wrote: > On 7/1/2010 10:00 AM Andreas Waldenburger said... > > On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman > > wrote: > > > >> I'll have to give the left-handed mouse a try... hmmm -- not too > >

Re: Solutions for hand injury from computer use

2010-07-01 Thread Andreas Waldenburger
On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman wrote: > I'll have to give the left-handed mouse a try... hmmm -- not too bad > so far. Since we're on the subject: I find the best solution for "lots of typing with a little mousing" to be a keyboard with a pointing stick (or track point or nav st

Re: I strongly dislike Python 3

2010-06-27 Thread Andreas Waldenburger
On Sun, 27 Jun 2010 02:45:37 +0100 Nobody wrote: > On Sat, 26 Jun 2010 21:08:48 +0200, Martin v. Loewis wrote: > > >> I think that's not true. If enough people want to support Python 2 > >> it might be possible to advance Python 2. > > > > That won't be sufficient: enough people wanting support

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 13:56:43 +0200 (CEST) "Jerry Rocteur" wrote: > As part of learning Python, I'm also learning OOP! That is why I want > to know if this is doable using classes. Everything[1] is doable using classes. The question is: Do you *need* to do it with classes? If your problem is best

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 10:49:49 -0400 "D'Arcy J.M. Cain" wrote: > Python is executible pseudocode. > I don't know about you, but if I didn't know this to be praise, it'd sound like an insult to me. As in "Timecube is expendable pseudoscience". Phrases like "Your mother [has property x]" have the

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 19:38:43 +1000 James Mills wrote: > When I came across Rub* I found it to be just a rip-off of Python (in > some respects) and couldn't understand how it became popular so > quickly :) You answered your own question: It's a rip-off of Python. On a more serious note, though,

Re: Community (A Modest Proposal)

2010-06-15 Thread Andreas Waldenburger
On Tue, 15 Jun 2010 17:45:43 +1000 James Mills wrote: > I myself use vim (as my editor) and 2-3 Terminals on virtual > workspaces (in my DE). I guess the beauty with vim is you just read > the line no. type it in and hit ^G > You mean just G (Shift+g), right? ^G (Ctrl+G) prints the file name and

Re: GUIs - A Modest Proposal

2010-06-11 Thread Andreas Waldenburger
On Thu, 10 Jun 2010 23:00:37 -0700 (PDT) rantingrick wrote: > On Jun 11, 12:17 am, ant wrote: > > I like the points about backwards compatibility. Presumably that > > reason alone is enough to keep Tkinter in the standard library for a > > long while. > > I don't see why that is a good reason.

Re: regarding the dimensions in gui

2010-06-10 Thread Andreas Waldenburger
On Thu, 10 Jun 2010 08:37:21 +0100 Simon Brunning wrote: > On 10 June 2010 08:19, Shashwat Anand > wrote: > > And please stop using 'sir' for heaven's sake. > > Not least because list list isn't male only. > Not that I know a lot about Indian English, but I think the Indian mind tends to use

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 20:36:02 +0200 "Alf P. Steinbach" wrote: > * Andreas Waldenburger, on 04.06.2010 20:21: > > On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney > > wrote: > > > >> Andreas Waldenburger writes: > >> > >>> But c

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 09:28:23 -0700 Emile van Sebille wrote: > On 6/3/2010 10:41 PM Steven D'Aprano said... > > On Thu, 03 Jun 2010 06:15:20 -0400, Adam Tauno Williams wrote: > >> Most people use this list via e-mail, > > > > How do you know? Do you have evidence for this, or are you just > > maki

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney wrote: > Andreas Waldenburger writes: > > > But consolidation is the *only* way to go, really. The parallelism > > between c.l.p. and python-list is great already. Now throw some sort > > of Forum in the mix > > This

Re: Python Forum

2010-06-03 Thread Andreas Waldenburger
On Thu, 3 Jun 2010 03:16:03 -0700 (PDT) Pierre Quentel wrote: > So the OP's initiative should be an incentive to think on the format > of the interaction between all the range of Python users, from newbees > to gurus. We are in the 2.0 era, with social networks all over the > place using a pleasa

Re: Nested list problem - please...

2010-04-18 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 13:31:54 -0700 Chris Rebert wrote: > On Sat, Apr 17, 2010 at 12:40 PM, Martin Hvidberg > wrote: > > I have this code, it builds up a data structure of nested lists, > > and filling data in them. My problem is that it seems that one of > > the lists SA[1] is not a list of uniq

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 15:44:56 +0200 Andreas Waldenburger wrote: > On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler > wrote: > > > I got the following error: > > TypeError: unbound method duplica() must be called with TTT instance > > as first argument (got int instanc

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler wrote: > [snip actual question] Oh and a note on vocabulary: A "class method" is a somewhat advanced topic and quite probably not what you want here. They are not used very often. What I proposed in the other post was an "instance method", which i

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler wrote: > I got the following error: > TypeError: unbound method duplica() must be called with TTT instance > as first argument (got int instance instead) > > What am I doing wrong? Not reading the error message. You need to create a TTT instance

Re: In disGuiodoise?

2010-04-06 Thread Andreas Waldenburger
On Mon, 05 Apr 2010 22:03:00 +0200 News123 wrote: > Andreas Waldenburger wrote: > > On Mon, 05 Apr 2010 13:48:15 +0200 News123 wrote: > > > >> Martin P. Hellwig wrote: > >>> On 04/05/10 00:05, r wrote: > >>> > >>>> However i hav

Re: In disGuiodoise?

2010-04-05 Thread Andreas Waldenburger
On Mon, 05 Apr 2010 13:48:15 +0200 News123 wrote: > Martin P. Hellwig wrote: > > On 04/05/10 00:05, r wrote: > > > >> However i have also considered that maybe *all* the "well knowns" > >> are in fact the many colorful personalities of Guido. > >> > > > > > > De vraag is dan natuurlijk of al z

Re: off topic but please forgive me me and answer

2010-04-04 Thread Andreas Waldenburger
On Sun, 4 Apr 2010 13:59:57 +0200 Andreas Waldenburger wrote: > Computers by themselves have as much a notion of Rationals as they > have of Irrationals, or, for that matter, the cuteness puppies. Strike that. Floats in computers are Rationals. So computers do know them. However, they are

Re: off topic but please forgive me me and answer

2010-04-04 Thread Andreas Waldenburger
On Sat, 3 Apr 2010 23:13:51 -0700 (PDT) Mensanator wrote: > On Apr 3, 9:03 pm, Steven D'Aprano cybersource.com.au> wrote: > > On Sat, 03 Apr 2010 09:35:34 -0700, Mensanator wrote: > > > On Apr 3, 10:17 am, Steven D'Aprano > > cybersource.com.au> wrote: > > >> But you're not multiplying four num

Re: How to access args as a list?

2010-04-03 Thread Andreas Waldenburger
On Sat, 3 Apr 2010 23:52:42 + (UTC) kj wrote: > In kj writes: > > [snip] > >P.S. this is just an example; the function I want to implement has > >more parameters in its signature, with longer, more informative > >names. > > Andreas, perhaps this paragraph explains why I find your solution

Re: How to access args as a list?

2010-04-03 Thread Andreas Waldenburger
On Sat, 3 Apr 2010 22:58:43 + (UTC) kj wrote: > The best I have managed looks like this: > > class _Spam(object): > def __init__(self, x, y, z): > self.__dict__ = OrderedDict(()) > for p in inspect.getargspec(_Spam.__init__).args[1:]: > self.__dict__[p] = loc

Re: off topic but please forgive me me and answer

2010-04-03 Thread Andreas Waldenburger
On Sat, 03 Apr 2010 13:13:38 -0400 Steve Holden wrote: > Correct. Unfortunately, it doesn't help to use the right ones either. > In fact, that could almost be a definition of "crackpot" (and alas now > we approach territory where we risk offending the religious, so I will > cease and desist). E

Re: off topic but please forgive me me and answer

2010-04-02 Thread Andreas Waldenburger
On Thu, 01 Apr 2010 22:44:51 +0200 superpollo wrote: > how much is one half times one half? While everyone else is mocking you: Can you please elaborate on why you want to know and what kind of problem you're trying to solve with this? Also, don't you think you should have picked a maths forum f

Re: building a dict

2010-03-14 Thread Andreas Waldenburger
On Sun, 14 Mar 2010 08:36:55 -0400 Steve Holden wrote: > Andreas Waldenburger wrote: > > On Sat, 13 Mar 2010 13:42:12 -0800 (PST) vsoler > > wrote: > > > >> By the way, I suppose I am the OP. Since I am not an native English > >> speaking person, I do n

Re: building a dict

2010-03-13 Thread Andreas Waldenburger
On Sat, 13 Mar 2010 13:42:12 -0800 (PST) vsoler wrote: > By the way, I suppose I am the OP. Since I am not an native English > speaking person, I do not know what it stands for. Perhaps you can > tell me. > Perhaps you can find out yourself: http://www.urbandictionary.com/define.php?term=op /W

Re: to create variable from dict

2010-03-13 Thread Andreas Waldenburger
On Fri, 12 Mar 2010 06:50:18 -0800 (PST) Luis M. González wrote: > The question is: should you do it? And the answer is: No. And the usual disclaimer is: (Unless you *know* it's the best possible solution to your problem.) /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/pytho

Re: a simple def how-to

2010-03-07 Thread Andreas Waldenburger
On Sun, 7 Mar 2010 07:05:26 -0800 (PST) vsoler wrote: > Hello, > > My script starts like this: > > book=readFromExcelRange('book') > house=readFromExcelRange('house') > table=readFromExcelRange('table') > read=readFromExcelRange('read') > ... > > But I would like to have something equivalent,

Re: best practices: is collections.defaultdict my friend or not?

2010-03-05 Thread Andreas Waldenburger
On Fri, 5 Mar 2010 17:22:14 -0800 (PST) Pete Emerson wrote: > [snip] > >>> data['one'] = {} > >>> data['one']['two'] = 'three' > >>> print data > {'one': {'two': 'three'}} > > And through some research, I discovered collections.defaultdict (new > in Python 2.5, FWIW): > > >>> import collections

Re: best practices: is collections.defaultdict my friend or not?

2010-03-05 Thread Andreas Waldenburger
On Fri, 5 Mar 2010 17:22:14 -0800 (PST) Pete Emerson wrote: > I've been wrestling with dicts. I hope at the very least what I > discovered helps someone else out, but I'm interested in hearing from > more learned python users. > > I found out that adding a two dimensional element without definin

Re: Docstrings considered too complicated

2010-03-03 Thread Andreas Waldenburger
On Wed, 03 Mar 2010 22:19:04 +0100 mk wrote: > For the uncouth yobs, err, culturally-challenged: > > http://www.youtube.com/watch?v=Xe1a1wHxTyo > > (Four Yorkshiremen) > http://www.youtube.com/watch?v=-eDaSvRO9xA That's the definitive version. I mean, if you're going to talk vintage, talk vi

Re: Docstrings considered too complicated

2010-03-02 Thread Andreas Waldenburger
On Wed, 03 Mar 2010 08:22:40 +1100 Ben Finney wrote: > Andreas Waldenburger writes: > > > Don't get me wrong; our whole system is more fragile than I find > > comfortable. But I guess getting 10ish different parties around the > > globe to work in complete un

Re: Docstrings considered too complicated

2010-03-02 Thread Andreas Waldenburger
On Tue, 02 Mar 2010 19:05:25 +0100 Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: > > > > I had hoped that everyone just read it, went like "Oh geez.", > > smiled it off with a hint of lesson learned and got back to > > whatever it was they were

Re: Docstrings considered too complicated

2010-03-02 Thread Andreas Waldenburger
On Tue, 02 Mar 2010 09:48:47 +1100 Ben Finney wrote: > > It's not our concern. > > Then I don't see what that problem is. There is none. I was griping about how stupid they are. That is a personal problem I have with their *code* (not software), and I thought I'd just share my superiority com

Re: Docstrings considered too complicated

2010-03-02 Thread Andreas Waldenburger
On Mon, 01 Mar 2010 21:09:39 + Mark Lawrence wrote: > Andreas Waldenburger wrote: > > [snip] > > We did not buy code. If it were written in C or such, we would never > > get to see it. > > > > It's not our concern. > > > > /W > > >

Re: Docstrings considered too complicated

2010-03-01 Thread Andreas Waldenburger
On Mon, 01 Mar 2010 18:42:17 +0100 Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: > [snip] > > Back in the software world: Those guys write code that works. It > > does what it's supposed to do. Why should we care where they put > > their comments? >

Re: Docstrings considered too complicated

2010-03-01 Thread Andreas Waldenburger
On Mon, 01 Mar 2010 11:42:16 -0600 Robert Kern wrote: > On 2010-03-01 11:22 , Andreas Waldenburger wrote: > > > Back in the software world: Those guys write code that works. It > > does what it's supposed to do. Why should we care where they put > > their comments

Re: Docstrings considered too complicated

2010-03-01 Thread Andreas Waldenburger
On Tue, 02 Mar 2010 03:18:30 +1100 Lie Ryan wrote: > On 03/02/10 00:09, Andreas Waldenburger wrote: > > On Mon, 1 Mar 2010 05:01:49 -0800 (PST) alex23 > > wrote: > > > >> Andreas Waldenburger wrote: > >>> But as I said: a) I am (we are) not in a po

Re: Docstrings considered too complicated

2010-03-01 Thread Andreas Waldenburger
On Mon, 1 Mar 2010 05:01:49 -0800 (PST) alex23 wrote: > Andreas Waldenburger wrote: > > But as I said: a) I am (we are) not in a position to impose this (We > > don't work with the code, we just run the software). > > I personally believe that the end users ha

Re: Docstrings considered too complicated

2010-02-27 Thread Andreas Waldenburger
On Sat, 27 Feb 2010 07:29:46 -0800 (PST) John Pinner wrote: > A good way to control Python contractors is (given that firstly there > are functional specifications to comply with, and tests to pass) is to > impose the following condition: > > that all code delivered must reach a score of (say) 9

Re: Variable definition

2010-02-27 Thread Andreas Waldenburger
On 27 Feb 2010 03:33:57 GMT Steven D'Aprano wrote: > exec "'myPrefix_turquoise' = 42" > Not quite: In [1]: exec "'myPrefix_turquoise' = 42" File "", line 1 SyntaxError: can't assign to literal (, line 1) I think you meant: exec

Re: Docstrings considered too complicated

2010-02-26 Thread Andreas Waldenburger
On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk wrote: > On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: > > [stuff] > > Reminiscent of: > > mov AX,BX ; Move the contents of BX into AX > Well, there might be some confusion there as to what gets moved

Re: Docstrings considered too complicated

2010-02-26 Thread Andreas Waldenburger
On Fri, 26 Feb 2010 15:50:25 +0100 Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: > > > And they use mixedCase function/method names. > > > and ? whatIsTheProblem ? Thanks for proving my point. ;) No seriously though: Let it go. I wasn't being serious.

Re: Docstrings considered too complicated

2010-02-26 Thread Andreas Waldenburger
On Thu, 25 Feb 2010 12:51:00 -0800 (PST) John Roth wrote: > On Feb 24, 1:23 pm, Andreas Waldenburger > wrote: > > a company that works with my company writes a lot of of their code > > in Python (lucky jerks). I've seen their code and it basically > > looks like t

Docstrings considered too complicated

2010-02-24 Thread Andreas Waldenburger
Hi all, a company that works with my company writes a lot of of their code in Python (lucky jerks). I've seen their code and it basically looks like this: """Function that does stuff""" def doStuff(): while not wise(up): yield scorn Now my question is this: How do I kill these people

Re: Python and Ruby

2010-02-10 Thread Andreas Waldenburger
On Wed, 10 Feb 2010 09:51:11 -0500 Steve Holden wrote: > [snip] > It's as sensible to complain about people being "*forced* to keep > perfect indentation" as it is to complain about people being *forced* > to use braces to delimit code blocks. > > This is called "syntax", and it's a part of the

Re: Exception as the primary error handling mechanism?

2010-01-01 Thread Andreas Waldenburger
On Fri, 01 Jan 2010 11:34:19 +0100 "Martin v. Loewis" wrote: > Your observation is not wrong, but, as Benjamin already explained, > you are misinterpreting Michi Henning's statement. He doesn't condemn > exception handling per se, but only for the handling of *expected* > outcomes. He would consi

Re: multivariable assignment

2009-12-31 Thread Andreas Waldenburger
On Thu, 31 Dec 2009 08:13:35 -0800 (PST) davidj411 wrote: > I am not sure why this behavior is this way. > at beginning of script, i want to create a bunch of empty lists and > use each one for its own purpose. > however, updating one list seems to update the others. > > >>> a = b = c = [] No, y

Re: insert unique data in a list

2009-12-13 Thread Andreas Waldenburger
On 13 Dec 2009 17:57:47 GMT mattia wrote: > Using set does'n work (i.e. the python interpreter tells me: > TypeError: unhashable type: 'list')... Convert the lists to tuples before adding them. Tuples are hashable. /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: In lista infinita?

2009-12-08 Thread Andreas Waldenburger
On Tue, 08 Dec 2009 17:39:13 +0100 andrea wrote: > Ho notato che i generatori anche se infiniti non si lamentano se usati > in modo potenzialmente "pericoloso". > [...] > Altri miglioramenti/utilizzi trasversali? Maybe. But I'm sure it.comp.lang.python might help you better. And from the looks o

Re: How to create a docstring for a module?

2009-12-06 Thread Andreas Waldenburger
On Sat, 5 Dec 2009 23:04:42 -0800 (PST) "Dr. Phillip M. Feldman" wrote: > > If I create a module xyz.py with a docstring """xyz does everything > you could possibly want.""" at the top, the command ?xyz issued at > the IPython prompt does not display this docstring. What am I doing > wrong? St

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Andreas Waldenburger
On Sat, 05 Dec 2009 11:26:34 +0100 "Alf P. Steinbach" wrote: >* "function" is misleading in itself (due to the hijacking of this > term in mathematics), [...] Can you please elaborate? To me, a function is something that transforms some input to some output [1]. Which is exactly what Python

Re: easy question, how to double a variable

2009-09-22 Thread Andreas Waldenburger
On Mon, 21 Sep 2009 13:46:31 -0700 (PDT) daggerdvm wrote: > u don't want to answerthen why post?...get lost. You're not doing yourself a favor with this attitude, much less displaying it. You asked a question that you could have solved with 1 hour's worth of reading at most (much

Re: How to improve this code?

2009-09-15 Thread Andreas Waldenburger
On Mon, 14 Sep 2009 18:33:17 -0700 (PDT) André wrote: > Here's an example using sets: > > >>> def is_present(list_1, list_2): > ...if set(list_1).intersection(set(list_2)): > ... return True > ...return False > ... Not that it matters, but I'd probably write: def is_present(test,

Re: Google Code Jam language usage

2009-09-14 Thread Andreas Waldenburger
On Mon, 14 Sep 2009 11:17:02 -0400 Terry Reedy wrote: > At the recent Google Code Jam, Python was the 3rd most popular > language after C/C++ and Java. Good for C/C++ and Java that they are not ranked by "fun per line". /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-

  1   2   >