Re: Noob Question

2011-04-19 Thread Felipe Bastos Nunes
Yes, Dan is right, it looked for the sources, and you have only binaries on your system. Look in your distribution repositories for the *-devel or alike for the 5 that failed and try again. 2011/4/19 Dan Stromberg > On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray > wrote: > > Hi All, > > > > I

Re: Noob Question

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray wrote: > Hi All, > > I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When > I run 'make test', I receive several errors. The readme states that you can > generally ignore messages about skipped tests, but as you can see be

Re: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 1:33 PM, Rob McGillivray wrote: I am trying to install from an RPM downloaded from python.org. That puzzles me. For *nix, I do not see .rpm, just tarballs, on http://python.org/download/releases/3.2/ -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

RE: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Rob McGillivray
Reedy Sent: Tuesday, April 19, 2011 12:59 PM To: python-list@python.org Subject: 3.2 test failures on Centos 5.6 (was Re: Noob Question) On 4/19/2011 10:55 AM, Rob McGillivray wrote: > I'm new to Python, and trying to get python 3.2 installed on Centos > 5.6. When I run 'mak

3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 10:55 AM, Rob McGillivray wrote: I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When I run 'make test', I receive several errors. Welcome to Python. Newbie lesson 1: write an informative subject line that will catch the attention of people who can answe

Re: Noob question on 2 vs 3 Python releases

2010-12-29 Thread Anssi Saari
Franck Ditter writes: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? Well, Python 2.7 is the last major 2.x release, only bugfixes are done for it, like the 2.7.1 release. Actual developement is in the 3.x branch now. > Which one sh

Re: Noob question on 2 vs 3 Python releases

2010-11-14 Thread Dan Stromberg
On Sun, Nov 14, 2010 at 1:03 AM, Franck Ditter wrote: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? I hardly saw that in other > languages. Which one should I choose to start with, to cope with > the future ? Isn't 3.x supposed to ext

Re: Noob question on 2 vs 3 Python releases

2010-11-14 Thread Chris Rebert
On Sun, Nov 14, 2010 at 1:03 AM, Franck Ditter wrote: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? I hardly saw that in other > languages. You haven't heard of the infamous Perl 6? > Which one should I choose to start with, to cope

Re: Noob question

2009-01-30 Thread Bruno Desthuilliers
nanoe...@gmail.com a écrit : Hello? Hi. Ok, first, this is mostly OT here - your question should have gone to either the project's maintainer or any Ubuntu forum / mailing-list/whatever. I'm currently installed Ubuntu 8.10. I'm not a Linux person, so I don't know a lot about it. The rea

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Tim Rowe
2009/1/3 Russ P. : > So unless you think the standard library will someday include code for > air traffic management, I'll stick with camelCase, and I'll thank you > for not making an issue of it. Another late comment, sorry, but as an air traffic management safety consultant, I'm quite intereste

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Steven D'Aprano
On Sat, 17 Jan 2009 06:09:29 -0800, Aahz wrote: > You are missing the point: suppose you write a useful library in your > air traffic management application, maybe one that does a good job of > handling user input. If you have done a proper job of abstracting it > from your application as a whole

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Aahz
[following up late] In article <2b3c916e-6908-4b12-933f-8f7bfa86c...@i20g2000prf.googlegroups.com>, Russ P. wrote: > >Fair enough, but for code that is not intended for general public >usage (i.e., most code) so-called camelCase is every bit as good if >not better than using underscores to divide

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread J Kenneth King
"Gabriel Genellina" writes: > En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: > > >> The other day, I came upon this gem. It's a bit of perl embedded in a >> Makefile; this makes it even more gnarly because all the $'s get >> doubled to >> hide them from make: >> >> define absmondir >>

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread vk
> Anyone have something to say about the userio stuff? (If you're going to post something about my coding style, I invite you to do something infinitely more useful: write crapToPep8.py {or is it crap_to_pep8?} to satisfy your sick fetish for consistency.) -- http://mail.python.org/mailman/listinf

Re: Noob question: Is all this typecasting normal?

2009-01-05 Thread Gabriel Genellina
En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: The other day, I came upon this gem. It's a bit of perl embedded in a Makefile; this makes it even more gnarly because all the $'s get doubled to hide them from make: define absmondir $(shell perl -e ' \                              

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread James Mills
On Mon, Jan 5, 2009 at 1:47 PM, sprad wrote: > On Jan 3, 6:41 pm, Steven D'Aprano cybersource.com.au> wrote: >> The OP comes from a Perl background, which AFAIK allows you to concat >> numbers to strings and add strings to numbers. That's probably the (mis) >> feature he was hoping Python had. I

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread Roy Smith
In article , sprad wrote: > On Jan 3, 6:41 pm, Steven D'Aprano cybersource.com.au> wrote: > > The OP comes from a Perl background, which AFAIK allows you to concat > > numbers to strings and add strings to numbers. That's probably the (mis) > > feature he was hoping Python had. > > That's cor

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread sprad
On Jan 3, 6:41 pm, Steven D'Aprano wrote: > The OP comes from a Perl background, which AFAIK allows you to concat > numbers to strings and add strings to numbers. That's probably the (mis) > feature he was hoping Python had. That's correct -- and that's been one of the more difficult parts of my

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread alex goretoy
My gmail did that. FYI, it wasn't intentional. А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я Paula Poundstone - "I don't have a bank account because I don't know my mother's maiden name." On Sun, Jan 4, 2009 at

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 16:19:58 +0100, Bruno Desthuilliers wrote: > But indeed, you obviously cannot add strings with numerics nor > concatenate numerics with strings. This would make no sense. The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add strings

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 20:35:25 +, alex goretoy wrote: > for each his own. Please don't top-post. Please don't quote the ENTIRE body of text (PLUS doubling it by including a completely useless HTML version) just to add a trivial comment. Trim the text you are replying to. > Any more word on

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread vk
> Any more word on userio? None yet, I'm afraid. Should've started a different thread for it - but it's stuck here (in obscurity) forever xd. -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread alex goretoy
for each his own. Any more word on userio? On Sat, Jan 3, 2009 at 6:14 PM, Russ P. wrote: > On Jan 2, 10:50 pm, Ben Finney > > > > wrote: > > s0s...@gmail.com writes: > > > On Jan 2, 7:20 pm, Ben Finney > > > > > > > > wrote: > > > > They don't need to be creative; they merely need to confo

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Russ P.
On Jan 2, 10:50 pm, Ben Finney wrote: > s0s...@gmail.com writes: > > On Jan 2, 7:20 pm, Ben Finney > > wrote: > > > They don't need to be creative; they merely need to conform with > > > the naming scheme as laid out in the PEP. > > > If it's something to be included in the standard library, I ag

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Bruno Desthuilliers
sprad a écrit : I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), Actually, it's just plain object instanciation. and I'm wondering if it's normal, or if I'm missing an important idiom. For

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> Unless you explicitly *never* intend sharing your code with *anyone*, > it's best to code all your Python code in accordance with PEP 8 anyway. Well said. Let's bury the puppy already. Anyone have something to say about the userio stuff? -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
s0s...@gmail.com writes: > On Jan 2, 7:20 pm, Ben Finney > wrote: > > They don't need to be creative; they merely need to conform with > > the naming scheme as laid out in the PEP. > > If it's something to be included in the standard library, I agree > (just for consistency, not because using_un

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> etc etc ... IOW consider not biting off more than you can chew. It's possible that I am, but where's the fun without the risk? Good thinking in your post though! I will add "get_date" at some point, and I've modified "get_numeric" already. All-right, the moment you've all been waiting for: ---

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Russ P.
On Jan 2, 6:15 pm, s0s...@gmail.com wrote: > On Jan 2, 7:20 pm, Ben Finney > wrote: > > > vk writes: > > > > If there were, I would expect it to conform with PEP 8 (get those > > > > ugly camelCase names outta there :-) > > > > haha, please forgive me. > > > I'll try and think of some more creati

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Steven D'Aprano
On Fri, 02 Jan 2009 21:02:19 -0500, Steve Holden wrote: > Ben Finney wrote: >> vk writes: >> If there were, I would expect it to conform with PEP 8 (get those ugly camelCase names outta there :-) >>> haha, please forgive me. >>> I'll try and think of some more creative names. >> >> Th

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
On Jan 2, 6:57 pm, Andreas Waldenburger wrote: [snip] > You even assumed that distinction in your example: > > > >>> 'hello world".title() [snip] sorry, here is TitleCase.py_b2 py> 'hello world'.title().replace(' ', '') -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread s0suk3
On Jan 2, 7:20 pm, Ben Finney wrote: > vk writes: > > > If there were, I would expect it to conform with PEP 8 (get those > > > ugly camelCase names outta there :-) > > > haha, please forgive me. > > I'll try and think of some more creative names. > > They don't need to be creative; they merely n

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Steve Holden
Ben Finney wrote: > vk writes: > >>> If there were, I would expect it to conform with PEP 8 (get those >>> ugly camelCase names outta there :-) >> haha, please forgive me. >> I'll try and think of some more creative names. > > They don't need to be creative; they merely need to conform with the

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
vk writes: > > If there were, I would expect it to conform with PEP 8 (get those > > ugly camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. They don't need to be creative; they merely need to conform with the naming scheme as laid out

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread John Machin
On Jan 3, 11:16 am, vk wrote: > > If there were, I would expect it to conform with PEP 8 (get those ugly > > camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. > > atm, I've got a chem final to study for. > I'll probably post something re

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 16:44:11 -0800 (PST) r wrote: > On Jan 2, 6:26 pm, Andreas Waldenburger wrote: > > On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > > > > > If there were, I would expect it to conform with PEP 8 (get > > > > those ugly camelCase names outta there :-)   > > > > > haha, pl

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
On Jan 2, 6:26 pm, Andreas Waldenburger wrote: > On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > > > If there were, I would expect it to conform with PEP 8 (get those > > > ugly camelCase names outta there :-)   > > > haha, please forgive me. > > I'll try and think of some more creative nam

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > If there were, I would expect it to conform with PEP 8 (get those > > ugly camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. FYI: The names themselves aren't he problem at all. T

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> If there were, I would expect it to conform with PEP 8 (get those ugly > camelCase names outta there :-) haha, please forgive me. I'll try and think of some more creative names. atm, I've got a chem final to study for. I'll probably post something resembling useful code tomorrow morning. until

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
vk writes: > There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. > Like: > > import userio > > logic = userio.userio() > > number = logic.getNumeric("blah: ") # will offer the user a "re-do" in > case of bad input > number = logic.forceGetNu

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
> There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. [snip] +1 You are sooo right. You know, it is easy to forget about such things after you learn a language, i have written my own input logic, but i remember my __init__ days with python now a

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 14:36:04 -0800 (PST) vk wrote: > There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. > [snip example] > Great idea! +1 > ... but there isn't, as far as I know. Well, get to it, then. ;) /W -- My real email address is co

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> You might better do > > bet = int(raw_input("Enter your bet")) > > because then you don't need to later on convert bet again and again. This is all fine until you give it to an end-user. This is what I picture: $ ./script.py Enter your bet: $10 .. or perhaps "ten", "all", or a jillion other ta

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread TechieInsights
You can use the built-in string formatting options and operations. 2.5: http://www.python.org/doc/2.5.2/lib/typesseq-strings.html 2.6: http://docs.python.org/library/string.html In essence, you can do: print "You still have $%i remaining" %(money) On Jan 2, 2:15 pm, sprad wrote: > I've done a g

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Diez B. Roggisch
sprad schrieb: I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), and I'm wondering if it's normal, or if I'm missing an important idiom. It is normal, although below you make things needlessly

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Benjamin Kaplan
On Fri, Jan 2, 2009 at 4:15 PM, sprad wrote: > I've done a good bit of Perl, but I'm new to Python. > > I find myself doing a lot of typecasting (or whatever this thing I'm > about to show you is called), and I'm wondering if it's normal, or if > I'm missing an important idiom. > > For example: >

Re: noob question : library versus normal python files

2008-06-06 Thread [EMAIL PROTECTED]
On 6 juin, 19:36, रवींदर ठाकुर (ravinder thakur) <[EMAIL PROTECTED]> wrote: > hello friends, > > i have a python library(rdflib) that i am using in some project using > Google App Engine. I have developed everything using this on my local > machine and things work fine. But in my final deployment,

Re: Noob question

2008-01-07 Thread rocco . rossi
On Jan 7, 12:09 am, GHZ <[EMAIL PROTECTED]> wrote: > Had the same issue. What you want is: reload() Thanks :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question

2008-01-06 Thread GHZ
Had the same issue. What you want is: reload() -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question How do I run a Python script.

2007-06-30 Thread Bruno Desthuilliers
CarlP a écrit : > How do I run a Python script. usually, it's: $ python /path/to/somescript.py arg1 argN on a command line prompt. > I have one that gmail loader needs to > run on my email box. Here's the script > > http://www.marklyon.org/gmail/cleanmbox.py > > I can't seem to find what I ne

Re: noob question How do I run a Python script.

2007-06-28 Thread Matimus
> I installed python, run the interpreter and the script... Are you trying to run the script from the interpreter? You _can_ run scripts from the interpreter, but it isn't as simple as typing the name of the script. To me, that is what it sounds like you are trying to do. I don't know what environ

Re: noob question How do I run a Python script.

2007-06-28 Thread kyosohma
On Jun 28, 12:17 pm, CarlP <[EMAIL PROTECTED]> wrote: > How do I run a Python script. I have one that gmail loader needs to > run on my email box. Here's the script > > http://www.marklyon.org/gmail/cleanmbox.py > > I can't seem to find what I need to run it. I installed python, run > the interpret

Re: Noob Question: Force input to be int?

2007-01-24 Thread consmash
On 23 Sty, 10:59, [EMAIL PROTECTED] wrote: > Hello everyone! > I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i >

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Jonsson
Ah, thank you for the respone! I have not gotten around to test it yet, but I hope it will work! :) -Daniel 2007-01-23 10:59:37 [EMAIL PROTECTED] wrote in message <[EMAIL PROTECTED]> > Hello everyone! > I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The sc

Re: Noob Question: Force input to be int?

2007-01-23 Thread Paul Rubin
[EMAIL PROTECTED] writes: > print "Select a build number from 0 to " + str(len(BuildList) - 1) > buildNum = int(raw_input('Select build #> ')) > > while buildNum > (len(BuildList) -1) or buildNum <= -1: > print > print "Error: Invalid build number!" > print "Sel

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Nogradi
> I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i > num = num + 1 > print > print "Select a build

Re: noob question

2006-09-22 Thread Jay
http://code.google.com/hosting/ xandeer wrote: > where is a good open-source project website? > thank-you > (sorry for being so annoying)(if I'm annoying)(if not then I'm not > sorry) -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question

2006-09-22 Thread John Salerno
xandeer wrote: > where is a good open-source project website? > thank-you > (sorry for being so annoying)(if I'm annoying)(if not then I'm not > sorry) > sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: [noob question] References and copying

2006-07-04 Thread Petr Prikryl
"zefciu" wrote in message news:[EMAIL PROTECTED] > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > > >>> a=[[1,2],[3,4]] > >>> b=a[1] > >>> b=[5,6] > >>

Re: [noob question] References and copying

2006-06-09 Thread bruno at modulix
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. Unless you explicitely ask for a copy (either using the copy module or a specific function or method), you'll get a reference. > I thought I understan

Re: [noob question] References and copying

2006-06-09 Thread Steve Holden
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > > a=[[1,2],[3,4]] b=a[1] b=[5,6] a > > [[1, 2], [3, 4]] >

Re: [noob question] References and copying

2006-06-09 Thread Boris Borcic
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > a=[[1,2],[3,4]] b=a[1] b=[5,6] a > [[1, 2], [3, 4]] >>>

Re: noob question: "TypeError" wrong number of args

2006-05-08 Thread Holger
And thank you gentlemen for turning my somewhat banale question into a worthwhile discussion. :-) I shall not forget self ever again! -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question: "TypeError" wrong number of args

2006-05-05 Thread bruno at modulix
Edward Elliott wrote: > bruno at modulix wrote: > >>Edward Elliott wrote: >> >>>Ah, well then, there's no need for a full-blown parser. It should >>>suffice to recognize a class definition and modify the parameter list of >>>every def indented one level further than that. >> >>won't do : >> >>cla

Re: noob question: "TypeError" wrong number of args

2006-05-04 Thread Edward Elliott
bruno at modulix wrote: > Edward Elliott wrote: >> Ah, well then, there's no need for a full-blown parser. It should >> suffice to recognize a class definition and modify the parameter list of >> every def indented one level further than that. > > won't do : > > class CounterExample(object): >

Re: noob question: "TypeError" wrong number of args

2006-05-04 Thread bruno at modulix
Edward Elliott wrote: > Ben Finney wrote: > >>As I understand it, the point was not what the code does, but to give >>a sample input (a Python program) for the "simple text processor" you >>described to wade through. > > > Ah, well then, there's no need for a full-blown parser. It should suffic

Re: noob question: "TypeError" wrong number of args

2006-05-04 Thread bruno at modulix
Ben Finney wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > >>Ben Finney a écrit : >> >>>So now you're proposing that this be a special case when a >>>function is declared by that particular syntax, and it should be >>>different to when a function is created outside the class >>>defin

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Ben Finney wrote: > As I understand it, the point was not what the code does, but to give > a sample input (a Python program) for the "simple text processor" you > described to wade through. Ah, well then, there's no need for a full-blown parser. It should suffice to recognize a class definition

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Ben Finney
Edward Elliott <[EMAIL PROTECTED]> writes: > Marc 'BlackJack' Rintsch wrote: > > Edward Elliott wrote: > >> I can prove that assertion too: make a simple text processor that > >> reads Python source code and outputs the same source code with > >> only one change: insert the string 'self" as the fi

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Marc 'BlackJack' Rintsch wrote: > Edward Elliott wrote: >> I can prove that assertion too: make a simple text processor that reads >> Python source code and outputs the same source code with only one change: >> insert the string 'self" as the first parameter of every "def >> somemethod". Next run t

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Ben Finney wrote: > My basis for rejecting the proposal is that it claims to offer net > simplicity, yet it breaks at least two of the admonishments that > simplify Python. As do other features of Python. Or did you forget the follow-up to the special cases "rule"? Special cases aren't special

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Ben Finney wrote: > Edward Elliott <[EMAIL PROTECTED]> writes: >> As long as we're trotting out aphorisms > > The ones I quoted were from Python. > >>> import this Yes I know where it's from. > You've misunderstood "don't repeat yourself". It advocates *one* > definition of any given thing i

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Ben Finney
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Ben Finney a écrit : > > So now you're proposing that this be a special case when a > > function is declared by that particular syntax, and it should be > > different to when a function is created outside the class > > definition and added as a met

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Ben Finney
Edward Elliott <[EMAIL PROTECTED]> writes: > As long as we're trotting out aphorisms The ones I quoted were from Python. >>> import this > how about DRY: Don't Repeat Yourself. The rule couldn't be clearer: > don't repeat your SELF. ;) Yet that's exactly what explicitly > declaring self do

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : (snip) > > Okay, let's start with writing a simple text processor for this little > mess:: > > def b(c): > def d(r, *s, **t): > print '***' > c(r, *s, **t) > return d > > What a nice, readable, highly pythoni

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Edward Elliott wrote: > I can prove that assertion too: make a simple text processor that reads > Python source code and outputs the same source code with only one change: > insert the string 'self" as the first parameter of every "def somemethod". > Next run the output so

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Bruno Desthuilliers
Edward Elliott a écrit : > bruno at modulix wrote: > >>Technically, they are still function objects. They are later wrapped >>into method descriptor objects (at lookup time IIRC, but ask a guru or >>read the doc to know for sure). And don't forget the case of nested >>functions... > > > I don't

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
bruno at modulix wrote: > Technically, they are still function objects. They are later wrapped > into method descriptor objects (at lookup time IIRC, but ask a guru or > read the doc to know for sure). And don't forget the case of nested > functions... I don't see how nested functions change anyth

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread bruno at modulix
Edward Elliott wrote: > Bruno Desthuilliers wrote: > >>But then, constructs like: >> >>class Obj(object): >> def method(...): ... >> method = staticmethod(method) >> >>or it's newer syntactic-sugar-version would become somewhat more >>difficult to parse properly - but I admit that this is beyo

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
bruno at modulix wrote: > And of course propose an implementation - perhaps the compiler.ast could > be useful ? Ugh. Just when I thought I'd seen my last abstract syntax tree, one rears its ugly head. -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Bruno Desthuilliers wrote: > But then, constructs like: > > class Obj(object): >def method(...): ... >method = staticmethod(method) > > or it's newer syntactic-sugar-version would become somewhat more > difficult to parse properly - but I admit that this is beyond my > knowledge. Hmm, th

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread Edward Elliott
Bruno Desthuilliers wrote: > IOW, let's give Edward some time to come up with enough rope so we can > hang him to the nearest (AS) Tree !-) That's all I ask. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question: "TypeError" wrong number of args

2006-05-03 Thread bruno at modulix
Bruno Desthuilliers wrote: (snip) > Since Python 3K is supposed to be the 'clean the warts and don't bother > breaking compat' rewrite of Python, you may as well propose a PEP on > this. You'll have to really prove it doesn't break anything else in the > object model, have strong and articulate arg

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Bruno Desthuilliers
Ben Finney a écrit : > Edward Elliott <[EMAIL PROTECTED]> writes: > > >>Compiler, interpreter, magic-codey-runny-thingy, whatever, at some point >>something has to translate this source code >> def method (self, a, b): something >>into a function object (or whatever you're calling the runnable c

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
Ben Finney wrote: > So the tradeoff you propose is: > > - Honour "explicit is better than implicit", but users are confused > over "why do I need to declare the instance in the method > signature?" > > against > > - Break "explicit is better than implicit", take away some of the >

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
Ben Finney wrote: > So now you're proposing that this be a special case when a function is > declared by that particular syntax, and it should be different to when > a function is created outside the class definition and added as a > method to the object at run-time. > > Thus breaking not only "ex

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Bruno Desthuilliers
Edward Elliott a écrit : > Bruno Desthuilliers wrote: > >>Edward, I know I told you so at least three times, but really, >>seriously, do *yourself* a favor : take time to read about descriptors >>and metaclasses - and if possible to experiment a bit - so you can get a >>better understanding of Pyt

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Ben Finney
Edward Elliott <[EMAIL PROTECTED]> writes: > Compiler, interpreter, magic-codey-runny-thingy, whatever, at some point > something has to translate this source code > def method (self, a, b): something > into a function object (or whatever you're calling the runnable code this > week). Call this

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Ben Finney
Edward Elliott <[EMAIL PROTECTED]> writes: > bruno at modulix wrote: > > class MyObj(object): > > def __init__(self, name): > > self.name = name > > class MyObj(object): > def __init__(name): > self.name = name So the tradeoff you propose is: - Honour "explicit is better than impl

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
Bruno Desthuilliers wrote: > Edward, I know I told you so at least three times, but really, > seriously, do *yourself* a favor : take time to read about descriptors > and metaclasses - and if possible to experiment a bit - so you can get a > better understanding of Python's object model. Then I'll

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Bruno Desthuilliers
Edward Elliott a écrit : > bruno at modulix wrote: > (snip) > >>You skipped the interesting part, so I repost it and ask again: how >>could the following code work without the instance being an explicit >>parameter of the function to be used as a method ? >> >>def someFunc(obj): >> try: >>pr

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
bruno at modulix wrote: > It is to be taken literally. Either you talk about how Python > effectively works or the whole discussion is useless. I started talking about the code-level view (programmer's perspective) so shorthand was fine. Now that we've moved on to interpreter/compiler-level stuff

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread bruno at modulix
Edward Elliott wrote: > bruno at modulix wrote: > >>>that 1) b is an object not a module*, and 2) objects pass references to >>>themselves as the first argument to their methods. >> >>Nope. It's the MethodType object (a descriptor) that wraps the function >>that do the job. The object itself is to

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
bruno at modulix wrote: >> that 1) b is an object not a module*, and 2) objects pass references to >> themselves as the first argument to their methods. > > Nope. It's the MethodType object (a descriptor) that wraps the function > that do the job. The object itself is totally unaware of this. It'

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread bruno at modulix
Edward Elliott wrote: > Holger wrote: > >>oops, that was kinda embarrassing. > > > It's really not. You got a completely unhelpful error message saying you > passed 2 args when you only passed one explicitly. The fact the b is also > an argument to b.addfile(f) is totally nonobvious until you

Re: noob question: "TypeError" wrong number of args

2006-05-02 Thread Edward Elliott
Steve Holden wrote: > Objects don't actually "pass references to themselves". The interpreter > adds the bound instance as the first argument to a call on a bound method. Sure, if you want to get technical For that matter, objects don't actually call their methods either -- the interpreter looks

Re: noob question: "TypeError" wrong number of args

2006-05-01 Thread BartlebyScrivener
No way. You didn't deserve it. Unless you came from another OO language, the Guido tutorial on Classes is unintelligible. It assumes way too much knowledge. But I found something else that looks promising that you may want to peek at: http://pytut.infogami.com/node11-baseline.html rd Reply --

Re: noob question: "TypeError" wrong number of args

2006-05-01 Thread doobiz
Just my opinion, but I think the Guido tutorial on Classes is unintelligible unless you're coming from another OO language. But I found something else that looks promising that you may want to peek at: http://pytut.infogami.com/node11-baseline.html rd -- http://mail.python.org/mailman/listinf

Re: noob question: "TypeError" wrong number of args

2006-05-01 Thread Steve Holden
Edward Elliott wrote: > Holger wrote: > >>oops, that was kinda embarrassing. > > > It's really not. You got a completely unhelpful error message saying you > passed 2 args when you only passed one explicitly. The fact the b is also > an argument to b.addfile(f) is totally nonobvious until you

Re: noob question: "TypeError" wrong number of args

2006-05-01 Thread Edward Elliott
Holger wrote: > oops, that was kinda embarrassing. It's really not. You got a completely unhelpful error message saying you passed 2 args when you only passed one explicitly. The fact the b is also an argument to b.addfile(f) is totally nonobvious until you know that 1) b is an object not a modu

  1   2   >