| 4 | from validate import String, PositiveInteger, PositiveFloat |
| 5 | |
| 6 | class Stock(Structure): |
| 7 | name = String() |
| 8 | shares = PositiveInteger() |
| 9 | price = PositiveFloat() |
| 10 | |
| 11 | @property |
| 12 | def cost(self): |
| 13 | return self.shares * self.price |
| 14 | |
| 15 | def sell(self, nshares: PositiveInteger): |
| 16 | self.shares -= nshares |
nothing calls this directly
no test coverage detected