microblog icon indicating copy to clipboard operation
microblog copied to clipboard

super(Class, self) -> super()

Open TimoRJensen opened this issue 4 years ago • 4 comments

https://github.com/miguelgrinberg/microblog/blob/8f43aadd412cd141effccedf1cfe2bff4e0d1f0d/app/forms.py#L41

Hi Miguel, many many thanks for creating this absolute masterpiece of tutorial! I cannot tell you how much I appreciate all the work and time put into it. You are the real MVP!

I'm trying to give back to you and show my appreciation by writing this. I noticed a very minor enhancement that could be done here. If I'm not mistaken super() shouldn't be called with any arguments in Python 3 anymore. So I think this line should be:

super().__init__(*args, **kwargs)

Please feel absolutely free to ignore me on this one or tell me to ignore minor enhancements like this. I love your Mega-Tutorial and all the other great stuff you are doing for the Flask and Python Communities!

TimoRJensen avatar Nov 24 '21 22:11 TimoRJensen

You are correct, this is a left over from back in the day when this tutorial had to work on both Python 2 and 3.

miguelgrinberg avatar Nov 24 '21 22:11 miguelgrinberg

Is this open for contribution as python2 is a thing a past now. I would be happy to make a PR.

targhs avatar Jun 12 '22 07:06 targhs

Unfortunately I cannot merge PRs in this repository as that creates a problem with the carefully constructed commit history.

miguelgrinberg avatar Jun 12 '22 10:06 miguelgrinberg

Unfortunately I cannot merge PRs in this repository as that creates a problem with the carefully constructed commit history.

😥

targhs avatar Jun 12 '22 13:06 targhs

Closing as this does not apply to the new edition of this tutorial.

miguelgrinberg avatar Dec 03 '23 10:12 miguelgrinberg