On Thu, 7 Apr 2022 at 15:41, Greg Ewing wrote:
> > if proudgobelin and corruptegobelin are published by a game_engine library,
> > the game_engine user would most likely not be aware (nor should he care)
> > that they both inherit from a same parent.
>
> If someone is going to munge those
On 7/04/22 5:22 am, malmiteria wrote:
Also, i believe the idea of using anything but super to access a parent methods
is far from obvious to most people.
That might be true for people who learned Python recently enough. When
I started using Python, super didn't even exist, so I got used to
On Thu, 7 Apr 2022 at 10:19, Brian McCall
wrote:
>
> > Agreed, this is just using Python as a glorified calculator. I understand
> > that this is just an example, but I *am* curious, is the bulk of what you
> > do simply calculations like this, or do your more complicated examples tend
> > to
On 6/04/22 8:58 pm, Mark Dickinson via Python-ideas wrote:
I'd be curious to know what alternatives you see. When a user writes `x + y`
with both `x` and `y` instances of `decimal.Decimal`, the decimal module needs
to know what precision to compute the result to (as well as what rounding mode
> Agreed, this is just using Python as a glorified calculator. I understand
> that this is just an example, but I *am* curious, is the bulk of what you do
> simply calculations like this, or do your more complicated examples tend to
> be more like actual programs?
I have never shipped code
Mike and Andre, thanks for the links!
I was indeed planning to take a crack at implementing some ideas. First, for my
part, I need to get approval from the people who own my intellectual property
;-)
I also figured it would take me a while to sift through the Python code, which
I have never
On Wed, Apr 6, 2022 at 7:05 PM Mike Miller
wrote:
>
> On 2022-04-06 12:36, Paul Moore wrote:
>
> > And if new syntax is a clear win even with such a library,
> > then designing a language feature that enables better syntax for that
> > library would still be possible (and there would be a clear
On 2022-04-06 12:36, Paul Moore wrote:
And if new syntax is a clear win even with such a library,
then designing a language feature that enables better syntax for that
library would still be possible (and there would be a clear use case
for it, making the arguments easier to make).
If
On Thu, 7 Apr 2022 at 07:41, Brendan Barnwell wrote:
>
> On 2022-04-06 14:28, Chris Angelico wrote:
> > What do the specialized libraries offer that Decimal doesn't? Is it
> > really worth all that hassle for the sake of teaching something that,
> > in production, would just be done with floats
On 2022-04-06 14:28, Chris Angelico wrote:
What do the specialized libraries offer that Decimal doesn't? Is it
really worth all that hassle for the sake of teaching something that,
in production, would just be done with floats and the math module
anyway?
If the decimal module did not already
On Wed, 6 Apr 2022 at 21:47, Chris Angelico wrote:
>
> On Thu, 7 Apr 2022 at 05:37, Oscar Benjamin
> wrote:
> > >
> > > Not so obvious to me, as it would require inordinate amounts of
> > > fiddling around when you want to dynamically adjust your precision.
> > > You'd have to reassign every
On Thu, 7 Apr 2022 at 07:22, Oscar Benjamin wrote:
>
> On Wed, 6 Apr 2022 at 21:47, Chris Angelico wrote:
> >
> > On Thu, 7 Apr 2022 at 05:37, Oscar Benjamin
> > wrote:
> > > >
> > > > Not so obvious to me, as it would require inordinate amounts of
> > > > fiddling around when you want to
On Thu, 7 Apr 2022 at 05:37, Oscar Benjamin wrote:
>
> On Wed, 6 Apr 2022 at 17:48, Chris Angelico wrote:
> >
> > On Thu, 7 Apr 2022 at 02:17, Christopher Barker wrote:
> > >
> > > On Wed, Apr 6, 2022 at 5:11 AM Oscar Benjamin
> > > wrote:
> > >> > I'd be curious to know what alternatives you
On Wed, 6 Apr 2022 at 17:48, Chris Angelico wrote:
>
> On Thu, 7 Apr 2022 at 02:17, Christopher Barker wrote:
> >
> > On Wed, Apr 6, 2022 at 5:11 AM Oscar Benjamin
> > wrote:
> >> > I'd be curious to know what alternatives you see. When a user writes `x
> >> > + y` with both `x` and `y`
On Wed, 6 Apr 2022 at 16:51, Brian McCall
wrote:
> Before I get to this example, though, there is more to arguments for the
> "need" than just counter-examples. I keep using quotes because nothing is
> really a need for anything.
Yes, it's not about "need" in an absolute sense, but more about
> Unfortunately, Python simply doesn't have enough symbols available.
> Using precisely one opener/closer for each type is highly limiting,
> since the only characters available are those on a US-English keyboard
> and in the ASCII set. It would be nice if, for instance, ∅ could mean
> "new empty
Steven D'Aprano writes:
> > All we have today is the screwhammer, and in cases the screw part
> > don't work, you're telling me to get rid of it all. hammer part
> > included.
> That's not how I see it.
> I see that we have a screwdriver (inheritence, including multiple
> inheritence) which
Oops, my examples have some other problems:
> # λ = 550e-9nm
should be
> # λ = 550nm
and
> # λ = 550e-9 [nm]
should be
> # λ = 550 [nm]
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to
> Thank you for all the examples, that should help a lot. Out of curiosity,
> those are the corrected versions of the code? Where was the mistake in the
> original?
Happy to help! The original was unitless altogether, so that was the first
problem. The particular error was λ. I typically work
On Thu, 7 Apr 2022 at 02:17, Christopher Barker wrote:
>
> On Wed, Apr 6, 2022 at 5:11 AM Oscar Benjamin
> wrote:
>> > I'd be curious to know what alternatives you see. When a user writes `x +
>> > y` with both `x` and `y` instances of `decimal.Decimal`, the decimal
>> > module needs to know
On 4/6/22 08:50, Brian McCall wrote:
> Alright, now let's look at an example. Again, it's not my best, let's go with
it. This is just
> a calculation of the expected number of photons to reach a pixel through a
camera of a given
> f-number (F). I mentioned this has bitten me before. All that
On Wed, Apr 6, 2022 at 5:11 AM Oscar Benjamin
wrote:
> > >Personally I think giving Decimal a global context was a mistake, [...]
>
I agree here -- though honestly, I think the benefits of Decimal are often
misrepresented. Interestingly, the variable precision is the real bonus,
not the decimal
Wow, this thread has grown quite a bit in the last two days. And there's some
really good points raised alongside the light trolling here and there. While
the discussion around implementation is important and very interesting, I think
the question around motivation is critical. Since I see some
On 4/6/2022 2:23 PM, Jeff Edwards wrote:
I will say I think that last comment misses the point. It’s true that
environment variable boolean configuration is definitely common enough
I wouldn’t balk at some normalized methods for handling it. But, I
think the point has been well made it’s an
Agreed!
On Wed, Apr 6, 2022 at 7:31 AM Eric V. Smith wrote:
> On 4/6/2022 2:23 PM, Jeff Edwards wrote:
>
> I will say I think that last comment misses the point. It’s true that
> environment variable boolean configuration is definitely common enough I
> wouldn’t balk at some normalized methods
I will say I think that last comment misses the point. It’s true that
environment variable boolean configuration is definitely common enough I
wouldn’t balk at some normalized methods for handling it. But, I think the
point has been well made it’s an opinionated choice that Python can’t force
on
On Wed, 6 Apr 2022 at 09:59, Mark Dickinson via Python-ideas
wrote:
>
> Broken off from the "Custom literals, a la C++" thread:
>
> Greg Ewing wrote:
> >Personally I think giving Decimal a global context was a mistake, [...]
> > so arguing that "it's no worse than Decimal" isn't going to do much
On Wed, Apr 06, 2022 at 08:34:35PM +1200, Greg Ewing wrote:
> On 6/04/22 10:41 am, Chris Angelico wrote:
> >I don't think anyone would ever say that a
> >parsec (several light years) should be considered equivalent to a
> >second of latitude (a handful of meters) just because they both have
> >an
On Wed, Apr 06, 2022 at 08:28:59PM +1200, Greg Ewing wrote:
> I actually think super() is misnamed and should really be called
> next_class() or something like that. There might be less confusion
> about its intended use then.
Heh, we should rename it frábær(), that will ensure that nobody will
On Tue, Apr 05, 2022 at 09:55:00PM +1200, Greg Ewing wrote:
> I would also say that if you're passing super anything *other*
> than the class where the method is defined, you're trying to
> be too clever by half, and will get bitten.
+1
In Python 3, you should (nearly?) always just call the
On Mon, Apr 04, 2022 at 09:45:32PM -, malmiteria wrote:
> All we have today is the screwhammer, and in cases the screw part
> don't work, you're telling me to get rid of it all. hammer part
> included.
That's not how I see it.
I see that we have a screwdriver (inheritence, including
On Tue, Apr 05, 2022 at 04:27:45PM +0100, Paul Moore wrote:
> On Tue, 5 Apr 2022 at 12:37, malmiteria wrote:
> > 5) replacing MRO with a method resolution that I describe at the top
> > of my post: - accessing an attribute / method that multiple parent
> > can provide would raise an
On Wed, Apr 06, 2022 at 02:47:57AM +1200, Greg Ewing wrote:
> I think you misunderstand the reason why super() accepts a class
> argument.
>
> It's purely for historical reasons.
No, it is because it actually does need to know which class it is being
called from, as well as the object that
Broken off from the "Custom literals, a la C++" thread:
Greg Ewing wrote:
>Personally I think giving Decimal a global context was a mistake, [...]
> so arguing that "it's no worse than Decimal" isn't going to do much
> to convince me. :-)
I'd be curious to know what alternatives you see. When a
On 6/04/22 10:41 am, Chris Angelico wrote:
I don't think anyone would ever say that a
parsec (several light years) should be considered equivalent to a
second of latitude (a handful of meters) just because they both have
an angular size of one second!
Although if you're Han Solo then it's a
On 6/04/22 5:52 am, malmiteria wrote:
Some exemple i give including, but not limited to the gobelin exemple are a
fair use case in which you'd want to use the argumented version of super.
No, the gobelin example is an example of when NOT to use super().
Multiple people have told you that,
On 5/04/22 4:17 pm, Chris Angelico wrote:
If your application
needs to use both statute and nautical miles in the same module (most
likely the main module), then it's going to have an issue,
If there's a single global registry, and they both register the
unit under the same name, then there
37 matches
Mail list logo