Package auction :: Package english :: Module bid :: Class Bid
[hide private]
[frames] | no frames]

Class Bid

source code

object --+
         |
        Bid

The class Bid represents maximum bids made for items in up for auction in an electronic auction house. A bid object is immutable after creation.

Instance Methods [hide private]
 
__init__(self, bidder, limit)
Creates a new bid with the given bidder and limit price.
source code
 
get_bidder(self)
Returns the name of the person who made the bid.
source code
 
get_limit(self)
Returns the maximum price the bidder is willing to pay.
source code
 
is_higher_than(self, another_bid)
Determines if this bid is higher than another, given bid.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bidder, limit)
(Constructor)

source code 

Creates a new bid with the given bidder and limit price.

Parameters:
  • bidder - the bidding person's name
  • limit - the maximum price that the bidder is willing to pay for an item
Overrides: object.__init__

get_bidder(self)

source code 

Returns the name of the person who made the bid.

Returns:
bidder name

get_limit(self)

source code 

Returns the maximum price the bidder is willing to pay.

Returns:
limit price

is_higher_than(self, another_bid)

source code 

Determines if this bid is higher than another, given bid. That is, determines if this bid has a higher limit price than the given bid. If the given parameter is None, always returns True.

Parameters:
  • another_bid - another bid or None
Returns:
a boolean value indicating if this bid is higher than the given bid