Re: Python's numeric tower

2014-06-16 Thread Mark Lawrence
On 16/06/2014 04:38, Dan Sommers wrote: On Sun, 15 Jun 2014 22:17:57 -0400, Roy Smith wrote: I don't believe HandGrenade implements throw(). It does, however, implement lobbeth(). And therein lies the problem with Object Oriented Programming: instances of HandGrenade neither throw nor lobbet

Re: Python's numeric tower

2014-06-15 Thread Roy Smith
In article , Roy Smith wrote: > In article , > Chris Angelico wrote: > > > On Mon, Jun 16, 2014 at 11:57 AM, Roy Smith wrote: > > > In article , > > > Chris Angelico wrote: > > > > > >> I guess if you have a list of Numbers that are all the same type, you > > >> can probably sum them, but

Re: Python's numeric tower

2014-06-15 Thread Dan Sommers
On Sun, 15 Jun 2014 22:17:57 -0400, Roy Smith wrote: > I don't believe HandGrenade implements throw(). It does, however, > implement lobbeth(). And therein lies the problem with Object Oriented Programming: instances of HandGrenade neither throw nor lobbeth. One, Two, Five'ly yours, Dan -- htt

Re: Python's numeric tower

2014-06-15 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Jun 16, 2014 at 11:57 AM, Roy Smith wrote: > > In article , > > Chris Angelico wrote: > > > >> I guess if you have a list of Numbers that are all the same type, you > >> can probably sum them, but you can sum non-Numbers too. The docstring > >> is

Re: Python's numeric tower

2014-06-15 Thread Chris Angelico
On Mon, Jun 16, 2014 at 11:57 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> I guess if you have a list of Numbers that are all the same type, you >> can probably sum them, but you can sum non-Numbers too. The docstring >> is a bit vague - sure, it's a number, but what can you

Re: Python's numeric tower

2014-06-15 Thread Roy Smith
In article , Chris Angelico wrote: > I guess if you have a list of Numbers that are all the same type, you > can probably sum them, but you can sum non-Numbers too. The docstring > is a bit vague - sure, it's a number, but what can you do with it? You can use it to count to three! -- https://m

Re: Python's numeric tower

2014-06-15 Thread Chris Angelico
On Mon, Jun 16, 2014 at 10:38 AM, Steven D'Aprano wrote: > Mathematically, ℂ (complex) is a superset of ℝ (real), and Decimals are a > kind of real(ish) number, like float: The Python complex type represents a subset of ℂ. The Python Decimal and float types implement a subset of ℝ, which as you s

Re: Python's numeric tower

2014-06-15 Thread Steven D'Aprano
On Sun, 15 Jun 2014 13:28:44 -0400, Roy Smith wrote: > In article <539dbcbe$0$29988$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Sun, 15 Jun 2014 01:22:50 -0600, Ian Kelly wrote: >> >> > On Sat, Jun 14, 2014 at 8:51 PM, Steven D'Aprano >> > wrote: >> >> Does anyone kn

Re: Python's numeric tower

2014-06-15 Thread Ian Kelly
On Sun, Jun 15, 2014 at 11:28 AM, Roy Smith wrote: > In article <539dbcbe$0$29988$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Sun, 15 Jun 2014 01:22:50 -0600, Ian Kelly wrote: >> >> > On Sat, Jun 14, 2014 at 8:51 PM, Steven D'Aprano >> > wrote: >> >> Does anyone know a

Re: Python's numeric tower

2014-06-15 Thread Roy Smith
In article <539dbcbe$0$29988$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 15 Jun 2014 01:22:50 -0600, Ian Kelly wrote: > > > On Sat, Jun 14, 2014 at 8:51 PM, Steven D'Aprano > > wrote: > >> Does anyone know any examples of values or types from the standard > >> library

Re: Python's numeric tower

2014-06-15 Thread Steven D'Aprano
On Sun, 15 Jun 2014 01:22:50 -0600, Ian Kelly wrote: > On Sat, Jun 14, 2014 at 8:51 PM, Steven D'Aprano > wrote: >> Does anyone know any examples of values or types from the standard >> library or well-known third-party libraries which satisfies >> isinstance(a, numbers.Number) but not isinstance

Re: Python's numeric tower

2014-06-15 Thread Ian Kelly
On Sat, Jun 14, 2014 at 8:51 PM, Steven D'Aprano wrote: > Does anyone know any examples of values or types from the standard > library or well-known third-party libraries which satisfies > isinstance(a, numbers.Number) but not isinstance(a, numbers.Complex)? >>> issubclass(decimal.Decimal, number