Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83277 > unrolled thread

Re: Comparisons and sorting of a numeric class....

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-01-06 21:34 -0500
Last post2015-01-06 21:34 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Comparisons and sorting of a numeric class.... Terry Reedy <tjreedy@udel.edu> - 2015-01-06 21:34 -0500

#83277 — Re: Comparisons and sorting of a numeric class....

FromTerry Reedy <tjreedy@udel.edu>
Date2015-01-06 21:34 -0500
SubjectRe: Comparisons and sorting of a numeric class....
Message-ID<mailman.17427.1420598144.18130.python-list@python.org>
On 1/6/2015 9:01 PM, Andrew Robinson wrote:

[snip]

There are very few (about 4) builtin classes that cannot be subclassed. 
  bool is one of those few, float is not.  Go ahead and subclass it.

 >>> class F(float): pass

 >>> F
<class '__main__.F'>
 >>> F(2.3) + F(3.3)
5.6


-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web