use @type docstrings for type inference rather than the (rather dumb) stuff I was doing before. also fix a bunch of stuff pointed out by PyCharm's code inspection tools