Top.Mail.Ru
? ?
Chouyu

chouyu_31


The ravings of a sane person.

Sometimes filled with information.


Previous Entry Share Flag Next Entry
A Case for Top and Bottom Values
Chouyu
chouyu_31
EDIT:
I've removed the text for the original submission. Why? Because it was ugly as hell. No reason to keep it.

I will instead now link to the official copy of PEP 326.

On the occasion where I update it before it gets into CVS (as is wont to happen), I'll be placing a local copy on my machine, which would be available here. Please note, my machine gets turned off when I go to sleep.



  • 1

Re: It's not really Some is it?

type is a "function" (read: callable object) that typcially returns the type of an object, but it creates a subtype if you pass it three arguments. type is also a type.

I don't see how making max and min more useful could possibly be any "worse" than that. I think it's really cool actually. max is a singleton that serves as a maximum value for any comparison that happens to have a callable that returns the maximum object in a sequence (read: something that supports the iterator protocol implicitly or explicitly).

I really think it's more attractive than adding members to cmp, which is a worse offense in my book. I don't know anywhere in (typical standard) Python where foo.bar is some useful type or singleton, except when foo is a module or package.

Re: It's not really Some is it?

You don't need to convince me, I'm sold on the min being the minimum and max being the maximum. I've already emailed the mailing list and offered it as an option, and am going to put it in the PEP as an "Open Issue".

  • 1