Greg Ewing wrote:
> For that purpose, hasattr(obj, '__call__') is sufficient,
> I think. And if it's not, the API you're trying to
> implement is ill-conceived in the first place, just like
> testing for sequenceness is not a well-defined operation.
I should add that for ipython's purposes, it se
Andrew Koenig wrote:
> I am uncomfortable about exposing the implementation this way, if only
> because it would require fixing the equivalence between callable() and
> hasattr(obj, '__call__') for all time.
I don't see anything bad about fixing that equivalence.
I regard the fact that it *wasn't
Guido van Rossum wrote:
> But I'm not proposing to use hasattr(obj, '__call__'). I'm basically
> saying that the callable test has very little to do with whether the
> later call will succeed, because we have no way to test the signature.
I don't think that's needed for the sort of things people
Nick Coghlan wrote:
> Rationalise *.pkg and *.pth files
> -
> [...]
>
> Use an interpreter configuration file?
> --
When dealing with these issues, please consider also startup time. Python is
already "pretty slow" at startup, an
> Then it becomes a matter of whether it's worth having callable()
> around as an alternative spelling. Those arguing in favour of
> it would have to explain whether we should also have addable(),
> subtractable(), mutiplyable(), indexable(), etc. etc. etc...
I'd love to be able to determine wheth
> Andrew Koenig wrote:
> > I note in PEP 3000 the proposal to remove callable(), with the comment
> "just call the object and catch the exception."
> I think that should be amended to "just use hasattr(obj. '__call__')
> instead". That's what callable() will become equivalent to once
> old_style
> Agreed. I think the people who want to use this as a test for whether
> a client passed them a usable object are barking up the wrong tree.
> What I do see it as useful for is making an api that accepts a
> foo-like-object, or a callable object that returns a foo-like-object.
Yes. What really g
On 7/18/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> But I'm not proposing to use hasattr(obj, '__call__'). I'm basically
> saying that the callable test has very little to do with whether the
> later call will succeed, because we have no way to test the signature.
Agreed. I think the people
On 7/18/06, Michael Urman <[EMAIL PROTECTED]> wrote:
> On 7/18/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> > I think that should be amended to "just use hasattr(obj. '__call__')
> > instead". That's what callable() will become equivalent to once
> > old_style classes are gone.
> >
> > Then it becom
On 7/18/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> I think that should be amended to "just use hasattr(obj. '__call__')
> instead". That's what callable() will become equivalent to once
> old_style classes are gone.
>
> Then it becomes a matter of whether it's worth having callable()
> around as a
Hi,
Greg Ewing wrote:
> Andrew Koenig wrote:
>> I note in PEP 3000 the proposal to remove callable(), with the comment "just
>> call the object and catch the exception."
>
> I think that should be amended to "just use hasattr(obj. '__call__')
> instead". That's what callable() will become equival
Andrew Koenig wrote:
> I note in PEP 3000 the proposal to remove callable(), with the comment "just
> call the object and catch the exception."
I think that should be amended to "just use hasattr(obj. '__call__')
instead". That's what callable() will become equivalent to once
old_style classes are
12 matches
Mail list logo