On Fri, Jul 22, 2016 at 11:13 PM, Dennis Lee Bieber
<[email protected]> wrote:
> Now... Going much beyond the assignment (if you were having trouble
> with the assignment, this will seem like magic) [Python 2.7]:
I'm not sure, but I think your code would become Py3 compatible if you
just change your prints. Which I'd recommend - it's not difficult to
just always print a single string, and most example code is ASCII-only
and has no difficulty with the bytes/unicode distinction. But, point
of curiosity...
> class Refrigerator(object):
> def __init__(self, stock=None):
> if stock is None or type(stock) != type(dict()):
> self._stock = dict()
> else:
> self._stock = stock
... why do you call up "type(dict())"? Why not either just "dict" or "type({})"?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list