The main reason for having not having characters and strings is
reducing complexity. Why try to add this now for no apparent
net benefit ?
I think the situation with bytes (iteration returning integers
instead of bytes) has shown that this not a very user friendly
nor intuitive approach:
>>> b =
I have encountered cases in which I would like to validate that an argument can
be properly compared with other instances of its type. This is true of numbers,
strings, dates, … but not for `NoneClass`, `type`, ….
One way that I have tried to handle this is to check whether the object can be
co
I think it’s usually called Orderable. It’s a useful concept in static type
checking too (e.g. mypy), where we’d use it as an upper bound for type
variables, if we had it. I guess to exclude sets you’d have to introduce
TotalOrderable.
On Tue, Mar 3, 2020 at 04:03 Steve Jorgensen wrote:
> I have
On Mar 3, 2020, at 01:09, M.-A. Lemburg wrote:
>
> The main reason for having not having characters and strings is
> reducing complexity. Why try to add this now for no apparent
> net benefit ?
I don’t think the benefit is worth the (as far as I can tell insurmountable)
backward compatibility
Guido van Rossum wrote:
> I think it’s usually called Orderable. It’s a useful concept in static type
> checking too (e.g. mypy), where we’d use it as an upper bound for type
> variables, if we had it. I guess to exclude sets you’d have to introduce
> TotalOrderable.
> On Tue, Mar 3, 2020 at 04:03
On Mon, Mar 2, 2020 at 7:12 PM Guido van Rossum wrote:
> Anyone can define their own singleton easily enough.
>
Sure, though there is far more utility in having a standard way to do
standard things.
But if anyone really thinks this is important, making a new Singleton that
behaves the way you w
On Tue, Mar 3, 2020 at 10:43 AM Steve Jorgensen wrote:
> Guido van Rossum wrote:
> > I think it’s usually called Orderable. It’s a useful concept in static
> type
> > checking too (e.g. mypy), where we’d use it as an upper bound for type
> > variables, if we had it. I guess to exclude sets you’d
On Tue, Mar 3, 2020 at 5:35 PM Guido van Rossum wrote:
> But beware, IIRC there are pathological cases involving floats, (long)
> ints and rounding where transitivity may be violated in Python (though I
> believe only Tim Peters can produce an example :-). I'm honestly not sure
> that that's enou
Guido van Rossum wrote:
> On Tue, Mar 3, 2020 at 10:43 AM Steve Jorgensen [email protected] wrote:
> > Guido van Rossum wrote:
> > I think it’s usually called Orderable. It’s a
> > useful concept in static
> > type
> > checking too (e.g. mypy), where we’d use it as an upper bound for type
> > vari
[Guido]
> But beware, IIRC there are pathological cases involving floats, (long) ints
> and rounding where transitivity may be violated in Python (though I believe
> only Tim Peters can produce an example :-).
Not anymore ;-) That is, while comparisons mixing bigints and floats
may have suffered
On 2020-03-04 00:58, Tim Peters wrote:
[Guido]
But beware, IIRC there are pathological cases involving floats, (long) ints
and rounding where transitivity may be violated in Python (though I believe
only Tim Peters can produce an example :-).
Not anymore ;-) That is, while comparisons mixing
On 4/03/20 7:42 am, Steve Jorgensen wrote:
That's a much better term. `Orderable` and `ProtoOrderable`.
I would suggest "TotallyOrdered" and "PartiallyOrdered".
--
Greg
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an e
Greg Ewing wrote:
> On 4/03/20 7:42 am, Steve Jorgensen wrote:
> > That's a much better term. Orderable and
> > ProtoOrderable.
> > I would suggest "TotallyOrdered" and "PartiallyOrdered".
Possibly, but the reasoning is not obvious to me. Can you explain? I get that
`TotallyOrdered` is consisten
At the moment, when you call a function, if there is any mismatch
between the function parameters and the supplied arguments, TypeError is
raised.
For example:
# Too few arguments
len()
# Too many arguments
ord('a', 'b')
# Invalid keywords
min([], func=len)
etc. (There
On Wed, Mar 4, 2020 at 6:04 PM Steve Jorgensen wrote:
>
> Greg Ewing wrote:
> > On 4/03/20 7:42 am, Steve Jorgensen wrote:
> > > That's a much better term. Orderable and
> > > ProtoOrderable.
> > > I would suggest "TotallyOrdered" and "PartiallyOrdered".
>
> Possibly, but the reasoning is not obvi
Chris Angelico wrote:
> On Wed, Mar 4, 2020 at 6:04 PM Steve Jorgensen [email protected] wrote:
> https://en.wikipedia.org/wiki/Partially_ordered_set
> "Partially ordered" means you can compare pairs of elements and find
> which one comes first. "Totally ordered" means you can compare ANY
> pair
Steve Jorgensen wrote:
> Chris Angelico wrote:
> > On Wed, Mar 4, 2020 at 6:04 PM Steve Jorgensen
> > [email protected] wrote:
> >
> > https://en.wikipedia.org/wiki/Partially_ordered_set
> > "Partially ordered" means you can compare pairs of elements and find
> > which one comes first. "Totally
On Wed, Mar 4, 2020 at 9:26 AM Steve Jorgensen wrote:
> Chris Angelico wrote:
> > On Wed, Mar 4, 2020 at 6:04 PM Steve Jorgensen [email protected] wrote:
>
> > https://en.wikipedia.org/wiki/Partially_ordered_set
> > "Partially ordered" means you can compare pairs of elements and find
> > which
On Wed, Mar 4, 2020 at 8:24 AM Steve Jorgensen wrote:
> Chris Angelico wrote:
> > On Wed, Mar 4, 2020 at 6:04 PM Steve Jorgensen [email protected] wrote:
>
> > https://en.wikipedia.org/wiki/Partially_ordered_set
> > "Partially ordered" means you can compare pairs of elements and find
> > which
19 matches
Mail list logo