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

Class Bid

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.
string
get_bidder(self)
Returns the name of the person who made the bid.
int
get_limit(self)
Returns the maximum price the bidder is willing to pay.
boolean
is_higher_than(self, another_bid)
Determines if this bid is higher than another, given bid.

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)

 

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

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

get_bidder(self)

 

Returns the name of the person who made the bid.

Returns: string
bidder name

get_limit(self)

 

Returns the maximum price the bidder is willing to pay.

Returns: int
limit price

is_higher_than(self, another_bid)

 

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 (bid object) - another bid or None
Returns: boolean
a boolean value indicating if this bid is higher than the given bid