-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
As far as I know, this is a return of issue #1085 and it still seems to be present in the current version of pylint. Here's the code I use:
class Customer(object):
"""
Attributes:
name: A string representing the customer's name.
balance: A float tracking the current balance of the customer's account.
"""
def __init__(self, name, balance=0.0):
"""Return a Customer object whose name is *name* and starting
balance is *balance*."""
self.name = name
self.balance = balance
def withdraw(self, amount):
"""Return the balance remaining after withdrawing *amount*
dollars."""
if amount > self.balance:
raise RuntimeError('Amount greater than available balance.')
self.balance -= amount
return self.balance
def deposit(self, amount):
"""Return the balance remaining after depositing *amount*
dollars."""
self.balance += amount
return self.balance
def bal(self):
return self.balance
class Subscriber(Customer):
def __init__(self, name, balance=0.0):
super().__init__(name, balance)
def loan(self, amount):
"""Allow withdrawing more than the amount they have, at a cost."""
self.balance -= amount * 0.1
print("Taken out {0} (10%) for loan cost".format(amount * 0.1))
self.balance -= amount
return self.balance
pylint --version output
pylint-1.8.4,
astroid-1.6.3
Python 3.6.5 (default, Mar 30 2018, 06:41:53)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
Metadata
Metadata
Assignees
Labels
No labels