I just posted an answer on Stack Overflow which is largely based on a specific part of a module in the CPython standard library. The Python license seems to be permissive and they also indicate compatibility with GPL but since code posted on Stack Overflow is automatically licensed under CC-BY-SA, I'm not sure if these two are compatible.
After reading the following two questions about derivative works of Python source code I'm inclined to believe it's no problem, but both answers also indicate that they prefer to release derivative work under the original license (which seems to conflict with the fact that Stack Overflow content is CC-BY-SA automatically).
- Copyright of modifications and derivative works of Python License 2 licensed software
- License for Python module derived from standard library module
So to summarize my question, I copied a portion of the CPython standard library source code, modified it slightly to my needs and included the modified version in one of my answers on Stack Overflow. Is that allowed per the Python license or does it cause a conflict?