python-distilled icon indicating copy to clipboard operation
python-distilled copied to clipboard

7.21 Page 194 -- typographical error in register_decoder function

Open samkramer opened this issue 2 years ago • 0 comments

Original version -- attempting to access mimetype attribute of string object:

def register_decoder(cls):
	for mt in cls.mimetypes:
		_registry[mt.mimetype] = cls
	return cls

Fixed version:

def register_decoder(cls):
    for mt in cls.mimetypes:
        _registry[mt] = cls
    return cls

samkramer avatar May 23 '23 12:05 samkramer