I'd do this with a generator, if the sequences do not have to be kept, but could be processed on the fly.
Using Alex's code as example that would stuff the whole block into a function, e.g. parseFasta() and then replace the records[header] = sequence with a yield sequence. The whole thing could then be used like this:
for seq in readFasta():
do_something_with_seq(seq)
Edit: You can get that very same functionality implemented in https://github.com/cschu/ktio. Or, I think pip install ktio and the n from ktio.ktio import readFasta should also work. (Sorry, badly documented!)