When I stepped through the code in debug, I noticed that all the colours in default_style were set to wx.Colour(-1, -1, -1, 255) which is wx.NullColour.
I found that if I explicitly set the default style, after creating the TextCtrl e.g.
then the subsequent call to t4.GetDefaultStyle() did return the correct colours and the call to SetStyle() did change the colour of the “e”, as required
How would your approach behave, if the default text colour is not black on white? That’s the reason, why I got the default style with GetDefaultStyle() and did not hardcode it.
This does not affect your solution, but I need to correct what I said earlier about the colour values in the default style being set to wx.NullColour.
If the default style has not been explicitly set, the colours in the wx.TextAttr returned by GetDefaultStyle() are actually set to different wx.Colour objects with the same parameter values as wx.NullColour, but are not set to the wx.NullColour object itself.
They do return True for equality with wx.NullColour, but return False for identity with wx.NullColour.