Python ValueError: too many values to unpack

self.materials is a dict and by default you are iterating over just the keys (which are strings). Since self.materials has more than two keys*, they can’t be unpacked into the tuple “k, m“, hence the ValueError exception is raised. In Python 2.x, to iterate over the keys and the values (the tuple “k, m“), we use self.materials.iteritems(). However, since you’re throwing the key away anyway, you may as … Read more

Clickable link inside message discord.py

As the other answer explained, you can’t add hyperlinks in normal messages, but you can in Embeds. I don’t see why you wouldn’t want to use an Embed for an error message, especially considering it adds more functionality, so you should consider using that. Feel free to mess around with the Embed & add some fields, a … Read more

Internal Redirect in Flask

You should use the Post-Redirect-Get pattern. And if you want to pass data to the target function (like that token) you can use the session object to store it So that would break down something like Edit: I haven’t used Flask-JWT before and didn’t know about the post requirement. But you can tell Flask to redirect … Read more

What are type hints in Python 3.5?

I would suggest reading PEP 483 and PEP 484 and watching this presentation by Guido on type hinting. In a nutshell: Type hinting is literally what the words mean. You hint the type of the object(s) you’re using. Due to the dynamic nature of Python, inferring or checking the type of an object being used is especially hard. This fact makes it hard for developers to understand what … Read more