Steven D'Aprano wrote:
> On Fri, 10 Mar 2006 02:19:10 +0100, Schüle Daniel wrote:
>
>
>>yeah, i miss some things in complex implementation
>>for example c=complex()
>>c.abs = 2**0.5
>>c.angle = pi/2
>>
>>should result in 1+1j :)
>
>
> Smiley noted, but consider:
>
> c = complex()
> => what is
On Fri, 10 Mar 2006 02:19:10 +0100, Schüle Daniel wrote:
> yeah, i miss some things in complex implementation
> for example c=complex()
> c.abs = 2**0.5
> c.angle = pi/2
>
> should result in 1+1j :)
Smiley noted, but consider:
c = complex()
=> what is the value of c here?
c.abs = 2**0.5
=> wha
Russ wrote:
> I'd like to get output formatting for my own classes that mimics the
> built-in output formatting. For example,
>
>
x = 4.54
print "%4.2f" % x
>
> 4.54
>
> In other words, if I substitute a class instance for "x" above, I'd
> like to make the format string apply to an elem
I'd like to get output formatting for my own classes that mimics the
built-in output formatting. For example,
>>> x = 4.54
>>> print "%4.2f" % x
4.54
In other words, if I substitute a class instance for "x" above, I'd
like to make the format string apply to an element or elements of the
instance.