compas-dev / compas-dev/compas
Point float arithmetic not mutable?!
Open
- Dominant language
- Python
- Stars
- 386
- Forks
- 122
- Avg merge
- 11d 46m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
The code means more than a thousand words:
```python
>>> p1 = cg.Point(1.2, 4, 3)
>>> p1
Point(x=1.2, y=4.0, z=3.0)
>>> p1 * 0.5
Point(x=0.6, y=2.0, z=1.5)
>>> 0.5 * p1
Traceback (most recent call last):
File "", line 1, in
TypeError: unsupported operand type(s) for *: 'float' and 'Point'
```
**Expected behavior**
No Errors
**Desktop (please complete the following information):**
- OS: Win/Linux
- Python version [e.g. 2.7]
- Python package manager [e.g. macports, pip, conda]
**Additional context**
Is this by design?!
Contributor guide
Assessment
This issue has not been assessed yet.