On Wed, 8 Dec 2021 at 19:59, Rob Cliffe via Python-ideas
<python-ideas@python.org> wrote:
>
> On 08/12/2021 19:27, Paul Moore wrote:
> >
> > The reason deferred objects keep coming up is because they *do* have a
> > much more compelling benefit - they help in a much broader range of
> > cases.
> That may be true.  I don't know.
> Can anyone provide some realistic use cases?

Of what? Deferred expressions? I ask because the rest of your post
seems to only be thinking in terms of argument defaults, when the
point I'm trying to make is that deferred expressions have uses
outside of that situation.

Honestly, I don't have particular examples off the top of my head.
It's not me that's arguing for deferred objects. I probably should
have worded that sentence as "The reason deferred objects keep coming
up is because the people interested in them are claiming that they
*do* have a much more compelling benefit - they help in a much broader
range of cases."

In the context of the current discussion about late-bound defaults, I
already said that deferred expressions could reasonably be declared
not relevant, and it wouldn't affect my core complaint, which is that
the benefit doesn't justify the costs. But certainly if someone does
propose introducing deferred expressions, I'd expect them to explain
the benefits, and I would expect that (a) one benefit would be that
they handle all of the cases that late-bound defaults cover, and (b)
there are further benefits in areas outside default values. That's
what I mean when I say that deferred expressions are a superset of the
functionality of late-bound defaults.

>  I've read the whole thread
> and I can only recall at most one, viz. the default value is expensive
> to compute and may not be needed.  But that is a good time *not* to use
> a late-bound default!  (The sentinel idiom would be better.)  Anything
> can be used inappropriately, that doesn't make it bad per se.
> I don't wish to disparage anyone's motives.  I am sure all the posts
> were made sincerely and honestly.  But without examples (of how deferred
> objects would be useful), if *feels to me* (no doubt wrongly) as if
> people are using a fig leaf to fight against this PEP.

I agree. But you're only responding to the last paragraph of my post.
Everything else I said was explaining my reservations over the
late-bound defaults proposal, and I *explicitly* said that those
reservations stand independent of any deferred expression proposal.

Honestly, it may feel to you that people are using weak arguments to
fight the PEP, but to me it feels like supporters of the PEP are
ignoring all of the *other* objections and trying to make the argument
entirely about deferred expressions. I guess we're both mistaken in
our feelings ;-)

Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/H5YHKYVWHNGCZ3PVF74YNCYVFMDU26YD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to