Re: function v. method

2006-08-02 Thread Alex Martelli
Gerhard Fiedler <[EMAIL PROTECTED]> wrote: > On 2006-07-25 05:16:04, Wesley Brooks wrote: > > >> prefix your names with _ or __. Both are ommited from autogenerated > >> docuementation and both are OFFICALLY not supposed to be used. > >> > > > > Could you elaborate on that a little or point me i

Re: function v. method

2006-07-25 Thread Gerhard Fiedler
On 2006-07-25 05:16:04, Wesley Brooks wrote: >> prefix your names with _ or __. Both are ommited from autogenerated >> docuementation and both are OFFICALLY not supposed to be used. >> > > Could you elaborate on that a little or point me in the right direction to > read up on it? I'm currently re

Re: function v. method

2006-07-25 Thread Wesley Brooks
(Apollogies to fuzzylollipop for replying to them rather than the list!) Python does have ALREADY have an OFFICAL mechanism for private members, prefix your names with _ or __. Both are ommited from autogenerateddocuementation and both are OFFICALLY not supposed to be used.Could you elaborate on th

Re: function v. method

2006-07-24 Thread Gerhard Fiedler
On 2006-07-24 14:41:02, Gerhard Fiedler wrote: > (I actually think that possibly the current way of embedding javadoc-like > documentation into sources is only a stepping stone into the direction > generally pointed to by what Wirth called "literate programming". That was Knuth, not Wirth. But t

Re: function v. method

2006-07-24 Thread Gerhard Fiedler
On 2006-07-24 13:25:14, fuzzylollipop wrote: >> So... the final authority /is/ the code. I don't see an alternative. For >> me, good abstraction doesn't mean I don't have to read the sources; good >> abstraction means (among other things) that I can read the sources easily. > having auto generate

Re: function v. method

2006-07-24 Thread fuzzylollipop
Antoon Pardon wrote: > On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > > > > Antoon Pardon wrote: > > > >> Suppose I am writing my own module, I use an underscore, to > >> mark variables which are an implementation detail for my > >> module. > >> > >> Now I need to import an other module

Re: function v. method

2006-07-24 Thread fuzzylollipop
Gerhard Fiedler wrote: > On 2006-07-22 16:32:38, danielx wrote: > > ...and source code... > >>> > >>> *shudders* What happened to all the goodness of abstraction? > >> > >> Abstraction as you seem to use it requires complete docs of the interface. > >> Which is what you said you don't have...

Re: function v. method

2006-07-24 Thread Bruno Desthuilliers
Antoon Pardon wrote: > On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >> >> >>>Suppose I am writing my own module, I use an underscore, to >>>mark variables which are an implementation detail for my >>>module. >>> >>>Now I need to import an other module in my modu

Re: function v. method

2006-07-24 Thread Bruno Desthuilliers
Antoon Pardon wrote: > On 2006-07-21, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >> >>>On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: >>> >>> danielx wrote: >> >>(snip) >> if you prefix with a single underscore, that tells the user, DON'T MES

Re: function v. method

2006-07-23 Thread Gerhard Fiedler
On 2006-07-22 16:32:38, danielx wrote: ...and source code... >>> >>> *shudders* What happened to all the goodness of abstraction? >> >> Abstraction as you seem to use it requires complete docs of the interface. >> Which is what you said you don't have... So the original abstractor broke >> th

Re: function v. method

2006-07-23 Thread Antoon Pardon
On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: > >> Suppose I am writing my own module, I use an underscore, to >> mark variables which are an implementation detail for my >> module. >> >> Now I need to import an other module in my module and need access >> to an i

Re: function v. method

2006-07-23 Thread Antoon Pardon
On 2006-07-21, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: >> >>>danielx wrote: >>> > (snip) >>> >>> >>>if you prefix with a single underscore, that tells the user, DON'T MESS >>>WITH ME FROM OUTSIDE! I AM AN IMPL

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > Bruno Desthuilliers wrote: > >>danielx a écrit : >> >>>Bruno Desthuilliers wrote: >>> >>> danielx wrote: >Bruno Desthuilliers wrote: > > > >>danielx wrote: >> (snip) >>>Obviously, such things would be omitted from you

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > Antoon Pardon wrote: > > On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > > > >>danielx wrote: > >> > (snip) > >> > >> > >>if you prefix with a single underscore, that tells the user, DON'T MESS > >>WITH ME FROM OUTSIDE! I AM AN IMPLEMENTATION DETAIL! > > > > >

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > (snip) > Sigh. I TOTALLY realize that Python works by politeness and not > enforcement. I think you are misinterpreting why I think this would be > a good idea. My concern is not with control, but with convenience. Having free access to implementation is convenient IMHO. > My

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > danielx a écrit : > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > >> > >>>Bruno Desthuilliers wrote: > >>> > >>> > danielx wrote: > > >> > >>(snip) > >> > >Obviously, such things would be omitted from your docs, but users also > >learn by intera

Re: function v. method

2006-07-22 Thread danielx
fuzzylollipop wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > danielx wrote: > > > > At first I was going to post the following: > > > > > > > > > > > > > > > (snip) > > > > > > > > > > > > > > > > but then I tried this: > > > > > > > > > > > res = Foo.__dict__['func'] > > >

Re: function v. method

2006-07-22 Thread Bruno Desthuilliers
danielx a écrit : > Bruno Desthuilliers wrote: > >>danielx wrote: >> >>>Bruno Desthuilliers wrote: >>> >>> danielx wrote: >> >>(snip) >> >Obviously, such things would be omitted from your docs, but users also >learn by interacting with Python, which is really one of Python's great

Re: function v. method

2006-07-22 Thread danielx
Gerhard Fiedler wrote: > On 2006-07-20 18:10:21, danielx wrote: > > >>> When supporting documents aren't sufficient to learn an api (I'm sure > >>> this never happens, so just humor me), you can always turn to > >>> interactive Python. > >> > >> ...and source code... > > > > *shudders* What happen

Re: function v. method

2006-07-22 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > >> > (snip) > >>> > >>>Obviously, such things would be omitted from your docs, but users also > >>>learn by interacting with Python, which is really one of Python's great > >>>virtues. When supportin

Re: function v. method

2006-07-21 Thread fuzzylollipop
Antoon Pardon wrote: > Suppose I am writing my own module, I use an underscore, to > mark variables which are an implementation detail for my > module. > > Now I need to import an other module in my module and need access > to an implementation variable from that module. So now I have > variables

Re: function v. method

2006-07-21 Thread Gerhard Fiedler
On 2006-07-20 18:10:21, danielx wrote: >>> When supporting documents aren't sufficient to learn an api (I'm sure >>> this never happens, so just humor me), you can always turn to >>> interactive Python. >> >> ...and source code... > > *shudders* What happened to all the goodness of abstraction?

Re: function v. method

2006-07-21 Thread Bruno Desthuilliers
Antoon Pardon wrote: > On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > >>danielx wrote: >> (snip) >> >> >>if you prefix with a single underscore, that tells the user, DON'T MESS >>WITH ME FROM OUTSIDE! I AM AN IMPLEMENTATION DETAIL! > > > Personnaly I don't like this convention. To b

Re: function v. method

2006-07-21 Thread Antoon Pardon
On 2006-07-21, fuzzylollipop <[EMAIL PROTECTED]> wrote: > > danielx wrote: >> Bruno Desthuilliers wrote: >> > danielx wrote: >> > > At first I was going to post the following: >> > > >> > > >> > > >> > (snip) >> > > >> > > >> > > >> > > but then I tried this: >> > > >> > > >> > res = Foo.__di

Re: function v. method

2006-07-21 Thread Bruno Desthuilliers
danielx wrote: > Bruno Desthuilliers wrote: > >>danielx wrote: >> (snip) >>> >>>Obviously, such things would be omitted from your docs, but users also >>>learn by interacting with Python, which is really one of Python's great >>>virtues. When supporting documents aren't sufficient to learn an api

Re: function v. method

2006-07-21 Thread Diez B. Roggisch
Alex Martelli schrieb: > danielx <[EMAIL PROTECTED]> wrote: > >>> ...and source code... >> *shudders* What happened to all the goodness of abstraction? > > Misses an l at the end: http://www.joelonsoftware.com/articles/LeakyAbstract

Re: function v. method

2006-07-20 Thread Alex Martelli
danielx <[EMAIL PROTECTED]> wrote: > > ...and source code... > > *shudders* What happened to all the goodness of abstraction? Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: function v. method

2006-07-20 Thread fuzzylollipop
danielx wrote: > Bruno Desthuilliers wrote: > > danielx wrote: > > > At first I was going to post the following: > > > > > > > > > > > (snip) > > > > > > > > > > > > but then I tried this: > > > > > > > > res = Foo.__dict__['func'] > > res is dan > > > > > > True > > > > > > And it all s

Re: function v. method

2006-07-20 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > > (snip) > >>>which gets me thinking again about > >>>the stuff I self-censored. Since the dot syntax does something special > >>>and unexpected in my case, > >> > >>"unexpected" ? Did you ever wond

Re: function v. method

2006-07-20 Thread Bruno Desthuilliers
danielx wrote: > Bruno Desthuilliers wrote: > >>danielx wrote: (snip) >>>which gets me thinking again about >>>the stuff I self-censored. Since the dot syntax does something special >>>and unexpected in my case, >> >>"unexpected" ? Did you ever wondered how the instance or class was >>passed as f

Re: function v. method

2006-07-19 Thread danielx
Duncan Booth wrote: > danielx wrote: > > Foo.func = dan# <-- Appearantly, something magical happens here, > because... > Foo.func > > > f = Foo.func > f is dan # <-- things begins to look suprising here. > > False > ismethod(f) > > True > > > > Imagine my

Re: function v. method

2006-07-19 Thread danielx
Leif K-Brooks wrote: > danielx wrote: > > This is still a little bit of magic, which gets me thinking again about > > the stuff I self-censored. Since the dot syntax does something special > > and unexpected in my case, why not use some more dot-magic to implement > > privates? Privates don't have

Re: function v. method

2006-07-19 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > > At first I was going to post the following: > > > > > > > (snip) > > > > > > > > but then I tried this: > > > > > res = Foo.__dict__['func'] > res is dan > > > > True > > > > And it all started to make sense. The surprising thing turned out

Re: function v. method

2006-07-18 Thread Bruno Desthuilliers
danielx wrote: > At first I was going to post the following: > > > (snip) > > > > but then I tried this: > > res = Foo.__dict__['func'] res is dan > > True > > And it all started to make sense. The surprising thing turned out to be > not so surprising: When the expression Foo.func

Re: function v. method

2006-07-18 Thread Duncan Booth
danielx wrote: Foo.func = dan# <-- Appearantly, something magical happens here, because... Foo.func > f = Foo.func f is dan # <-- things begins to look suprising here. > False ismethod(f) > True > > Imagine my surprise. Why would Python do this? > Not

Re: function v. method

2006-07-18 Thread Leif K-Brooks
danielx wrote: > This is still a little bit of magic, which gets me thinking again about > the stuff I self-censored. Since the dot syntax does something special > and unexpected in my case, why not use some more dot-magic to implement > privates? Privates don't have to be entirely absent from Klas

Re: function v. method

2006-07-17 Thread bayerj
I guess the python devs are not interested in implementing something that would require new syntax and does not give something entirely new to the language. The good thing about python is, that the devs are only implementing ideas that are very cool. There are a lot of cool (!= very cool) ideas in

function v. method

2006-07-17 Thread danielx
At first I was going to post the following: I just discovered the inspect module, which contains the isfunction and ismethod functions. For some reason, I used to be under the impression that Python methods are no different from Python functions. Naturally, I wondered why both of these needed to