[issue9906] including elementary mathematical functions in default types

2010-09-21 Thread Michael Gilbert
Michael Gilbert added the comment: the elementary functions are well-defined set, and i would include all of them. that includes exp, sqrt, ln, trig, and hyperbolic functions. i'll start a thread on python-ideas. thanks. -- ___ Python tr

[issue9906] including elementary mathematical functions in default types

2010-09-20 Thread Michael Gilbert
New submission from Michael Gilbert : hi, it would be really nice if elementary mathematical operations such as sin/cosine (via __sin__ and __cos__) were available as base parts of the python data model [0]. this would make it easier to write new math classes, and it would eliminate the

[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-09-20 Thread Michael Gilbert
Michael Gilbert added the comment: i think that, for example, the default __rsub__ implementation could be: return self + -other which should just do the right thing assuming the addition and negation functions already do the right thing for the class type. anyway, any implementation

[issue9401] automatically try forward operations when reverse operations are NotImplemented

2010-07-28 Thread Michael Gilbert
New submission from Michael Gilbert : in order to make overrides simpler, and more obvious to average developers, it would be very useful to automatically call the forward operations (e.g. __mul__) when the reverse operations (e.g. __rmul__) are NotImplemented. i spent quite a bit of time

[issue5823] feature request: a conditional "for" statement

2009-04-23 Thread Michael Gilbert
Michael Gilbert added the comment: hello, i've recently been working on some code where i am processing a list, but excluding certain items. the solution is to use a list comprehension in the for statement, which for example looks like: for m in [n for n in range( 0 , 5 ) if n

[issue5823] feature request: a conditional "for" statement

2009-04-23 Thread Michael Gilbert
New submission from Michael Gilbert : hello, i've recently been working on some code where i am processing a list, but excluding certain items. the solution is to use a list comprehension in the for statement, which for example looks like: for m in [n for n in range( 0 , 5 ) if n

[issue5822] inconsistent behavior of range when used in combination with remove

2009-04-23 Thread Michael Gilbert
Michael Gilbert added the comment: ok, i see now. the list itself is changed in place, and the return value of the remove() method is always None. since i din't assign the list to a variable in the first place, there is hence no way now to access that modified list. thanks for your

[issue5822] inconsistent behavior of range when used in combination with remove

2009-04-23 Thread Michael Gilbert
New submission from Michael Gilbert : using range in combination with remove is inconsistent. for example in python 2.x: >>> x = range(0,3) >>> x.remove(1) >>> x [0, 2] >>> x = range(0,3).remove(1) >>> x >>> and in python 3.x: >&