gpython icon indicating copy to clipboard operation
gpython copied to clipboard

Implement bool.real, bool.imag bool.conjugate()

Open corona10 opened this issue 6 years ago • 3 comments

There are some attributes that should be implemented for gpython.

Expected

>>> a = True
>>> a.imag
0
>>> a.real
1
>>> a.conjugate()
1

Actual

>>> a = True
>>> a.image
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
AttributeError: "'bool' has no attribute 'image'"
>>> a.real
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
AttributeError: "'bool' has no attribute 'real'"
>>> a.conjugate()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
AttributeError: "'bool' has no attribute 'conjugate'"

corona10 avatar Sep 09 '19 14:09 corona10

@ncw I am going to assign this issue to the contributhon 2019 participants

corona10 avatar Sep 09 '19 14:09 corona10

I want to take a look at this issue 🙌

parkchansoo avatar Sep 09 '19 14:09 parkchansoo

@parkchansoo Please go ahead. Here is a similar code you have to look at.

https://github.com/go-python/gpython/blob/7bc40057dc66c0ff15bb860c107b3c4664bc7b04/py/complex.go#L300

corona10 avatar Sep 09 '19 14:09 corona10