On 2013-10-25 22:01, Peter Otten wrote:
> > from functools import wraps
> > class require_keys:
> > def __init__(self, *keys):
> > self.keys = keys
> > def __call__(decorator_self, fn):
> > @wraps(fn)
> > def result_fn(method_self, *args, **kwargs):
> > # import pdb; pdb.set_t
Tim Chase wrote:
> Given the following example 2.7 code:
>
> from functools import wraps
> class require_keys:
> def __init__(self, *keys):
> self.keys = keys
> def __call__(decorator_self, fn):
> @wraps(fn)
> def result_fn(method_self, *args, **kwargs):
> # import pdb; pdb.
Given the following example 2.7 code:
from functools import wraps
class require_keys:
def __init__(self, *keys):
self.keys = keys
def __call__(decorator_self, fn):
@wraps(fn)
def result_fn(method_self, *args, **kwargs):
# import pdb; pdb.set_trace()
req = method_self.__
On Tue, Oct 9, 2012 at 5:51 PM, Steven D'Aprano
wrote:
> On Tue, 09 Oct 2012 11:08:13 -0600, Ian Kelly wrote:
>
>> I tend to view name mangling as being more for avoiding internal
>> attribute collisions in complex inheritance structures than for
>> designating names as private.
>
> Really? I tend
alex23 writes:
> On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M.
> Procida) wrote:
>> It certainly makes it quick to build a class with the attributes I need,
>> but it does make tracing logic sometimes a pain in the neck.
>>
>> I don't know what the alternative is though.
>
D.M. Procida於 2012年10月9日星期二UTC+8下午9時24分30秒寫道:
> What exactly is the point of a private method? Why or when would I want
>
Private methods in the object level are searched first
in the run time of python interpreter.
I did turn some private methods in to c programs from time t
On Wed, 10 Oct 2012 18:34:01 -0700, alex23 wrote:
> On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M.
> Procida) wrote:
>> It certainly makes it quick to build a class with the attributes I
>> need, but it does make tracing logic sometimes a pain in the neck.
>>
>> I don't know
On 11 Oct, 02:14, Mark Lawrence wrote:
> What language?
I think he's objecting to "bitch".
I had to block him on G+ because he kept asking me to self-censor
posts that he had _chosen to read_.
--
http://mail.python.org/mailman/listinfo/python-list
On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M.
Procida) wrote:
> It certainly makes it quick to build a class with the attributes I need,
> but it does make tracing logic sometimes a pain in the neck.
>
> I don't know what the alternative is though.
Components.
The examples
On 2012-10-10, Mark Lawrence wrote:
> On 10/10/2012 16:56, Ramchandra Apte wrote:
>> On Wednesday, 10 October 2012 18:38:04 UTC+5:30, Roy Smith wrote:
>>> Public: I hereby declare that this method or attribute is part of the
>>> promised never to change interface of this class. I might possibly
On 10/10/2012 16:56, Ramchandra Apte wrote:
On Wednesday, 10 October 2012 18:38:04 UTC+5:30, Roy Smith wrote:
Public: I hereby declare that this method or attribute is part of the
promised never to change interface of this class. I might possibly
break that promise at some point in the future,
> >
>
> > >
>
> > > Hardly a Python question but using a search engine could have got you
>
> > > here, and rather faster :)
>
> > >
>
> > http://stackoverflow.com/questions/2620699/why-private-methods-in-the-ob
>
> > ject-ori
method? Why or when would I want
> > > to use one?
> > >
> > > Daniele
> > >
> >
> > Hardly a Python question but using a search engine could have got you
> > here, and rather faster :)
> >
> http://stackoverflow.com/questions/262069
On 10/10/12 12:51 AM, Steven D'Aprano wrote:
On Tue, 09 Oct 2012 11:08:13 -0600, Ian Kelly wrote:
On Tue, Oct 9, 2012 at 8:08 AM, Demian Brecht
wrote:
A single underscore semantically means private. A double underscore
will name mangle the function such that it's only accessible strictly
by n
Demian Brecht wrote:
> On 12-10-09 04:51 PM, Steven D'Aprano wrote:
> > Really? I tend to view name mangling as a waste of time, and complex
> > inheritance structures as something to avoid.
>
> Yep, I've been coming around to this as of late.
I have a lot of inheritance. I don't know whether y
On 12-10-09 04:51 PM, Steven D'Aprano wrote:
Really? I tend to view name mangling as a waste of time, and complex
inheritance structures as something to avoid.
Yep, I've been coming around to this as of late.
--
Demian Brecht
@demianbrecht
http://demianbrecht.github.com
--
http://mail.python.o
On Tue, 09 Oct 2012 11:08:13 -0600, Ian Kelly wrote:
> On Tue, Oct 9, 2012 at 8:08 AM, Demian Brecht
> wrote:
>> A single underscore semantically means private. A double underscore
>> will name mangle the function such that it's only accessible strictly
>> by name through the class that it's defi
On 10/09/12 08:59, D.M. Procida wrote:
>> On 09/10/2012 14:24, D.M. Procida wrote:
>>> What exactly is the point of a private method? Why or when would I want
>>> to use one?
>
> In Python, using an underscore is simply a convention to note that a
> method is private - it doesn't actually hide it
:)
http://stackoverflow.com/questions/2620699/why-private-methods-in-the-ob
ject-oriented
Thanks. Sometimes I prefer to talk to real people on Usenet than do web
searches. Just my preference.
That's understandable, but the real people on Usenet who will answer your
questions usually p
On 12-10-09 06:59 AM, D.M. Procida wrote:
In Python, using an underscore is simply a convention to note that a
method is private - it doesn't actually hide it from other things -
correct?
Daniele
A single underscore semantically means private. A double underscore will
name mangle the functio
ou
> here, and rather faster :)
>
http://stackoverflow.com/questions/2620699/why-private-methods-in-the-ob
ject-oriented
Thanks. Sometimes I prefer to talk to real people on Usenet than do web
searches. Just my preference.
Anyway, one of the answers on that page explains that public methods are
i
On 09/10/2012 14:24, D.M. Procida wrote:
What exactly is the point of a private method? Why or when would I want
to use one?
Daniele
Hardly a Python question but using a search engine could have got you
here, and rather faster :)
http://stackoverflow.com/questions/2620699/why-private
>but why does it hava not private methods?
Because it does not need them, ain't it?
>Private stuff always makes programming much easier.
Does it? Sometimes contortion is needed to get rid of declarations
that restrain access, for example, when writing tests.
I think the point-of-vie
In article <[EMAIL PROTECTED]>,
Peter Hansen <[EMAIL PROTECTED]> wrote:
>Roy Smith wrote:
>> Simon Brunning <[EMAIL PROTECTED]> wrote:
>>>On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote:
Private stuff always makes programming much easier.
>>>
>>>That contention is, at best, debatable. See
>>
Have I missed something? Doesn't this mangle class methods:
class Foo:
def __bar(self):
print "bar"
Granted, you could probably figure out how the names are being
mangled. In the example above __bar is a defacto private method.
Griping about it not having `private' in front of it is asin
Roy Smith wrote:
Simon Brunning <[EMAIL PROTECTED]> wrote:
On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote:
Private stuff always makes programming much easier.
That contention is, at best, debatable. See
http://groups-beta.google.com/group/comp.lang.python/msg/b977ed1312e10b21.
Nice essay. Now,
In article <[EMAIL PROTECTED]>,
Simon Brunning <[EMAIL PROTECTED]> wrote:
> On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote:
> > Python is an oop language,
>
> Yes.
>
> > Private stuff always makes programming much easier.
>
> That contention is, at best, debatable. See
> http://groups-beta.g
On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote:
> Python is an oop language,
Yes.
> Private stuff always makes programming much easier.
That contention is, at best, debatable. See
http://groups-beta.google.com/group/comp.lang.python/msg/b977ed1312e10b21.
--
Cheers,
Simon B,
[EMAIL PROTECTED]
Trolls?
On 4/19/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> "could ildg" <[EMAIL PROTECTED]> wrote:
>
> > Private stuff always makes programming much easier.
>
> says who?
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-l
"could ildg" <[EMAIL PROTECTED]> wrote:
> Private stuff always makes programming much easier.
says who?
--
http://mail.python.org/mailman/listinfo/python-list
Python is an oop language,
but why does it hava not private methods?
And it even has not real private fields.
Will this never changed?
Private stuff always makes programming much easier.
--
鹦鹉聪明绝顶、搞笑之极,是人类的好朋友。
直到有一天,我才发觉,我是鹦鹉。
我是翻墙的鹦鹉。
--
http://mail.python.org/mailman/listinfo/python-list
31 matches
Mail list logo