Inheritance for TextBox

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v3.2.4
Standard Standalone? (y/n) If not then what?: n
What are you trying to achieve?: I had a class which inherited the TextStim class, but because TextStim is too slow for my purposes, I need to change my code to use TextBox. However, when I try to inherit Textbox in my Text class, and edit the parameters to match those of the TextBox syntax, I get these errors:
File “C:\Python36-32\lib\site-packages\BCPy2000\PsychoPyRenderer.py”, line 372, in
class Text(TextBox):
File “C:\Python36-32\lib\site-packages\psychopy\contrib\lazy_import.py”, line 195, in init
factory=cls._import)
File “C:\Python36-32\lib\site-packages\psychopy\contrib\lazy_import.py”, line 78, in init
scope[name] = self
TypeError: ‘str’ object does not support item assignment

I am currently working on wrapping the TextBox implementation, however I would like to keep the code the same so that I dont have to change much elsewhere. Here is my Text class:

class Text(TextBox):

def __init__(self, window=None, text='Hello world', font_name=None, font_size=32, position=(10,10), font_color=(0, 0, 0, 1), anchor='lower left', on=True, smooth=True):
	if BciGenericRenderer.subclass().screen is None:
		raise Exception('Stimuli can only be created after the screen is initialized!')
	 
	col, op = _colorFromBCItoPsyPy(color)
	TextBox.__init__(self,BciGenericRenderer.subclass().screen,text,font_color=col,opacity=op)
	if font_name is not None:
		self.font_name=font_name


	if 'center' in anchor:
		self.align_vert='center'
	if 'top' in anchor:
		self.align_vert='top'            
	if 'bottom' in anchor:
		self.align_vert='bottom'

	if 'center' in anchor:
		self.align_horz='center'
	if 'left' in anchor:
		self.align_horz='left'            
	if 'right' in anchor:
		self.align_horz='right'            
				 
	if position is not None: self.pos=Map2PsypyCoords(BciGenericRenderer.subclass().screen,position)
	 

def _font_name_fget(self):  return self.font
def _font_name_fset(self, val):
	self.font=val
font_name = property(_font_name_fget, _font_name_fset, doc='font name')
	 

def _font_size_fget(self):  pass
def _font_size_fset(self, val):
	pass
font_size = property(_font_size_fget, _font_size_fset, doc='font size')
 
# def _fget_angle(self): return self.angle
# def _fset_angle(self, val):
#     try: val = float(val)
#     except: raise TypeError('angle should be a floating-point scalar')
#     self.ori = val % 360.0
	 
# angle = property(_fget_angle, _fset_angle, doc='rotation angle in degrees')
 

def _fget_on(self):  return self._on
def _fset_on(self, val):
	try: val = bool(val)
	except: raise TypeError('on should be a boolean')
	self_on=on
	 
on= property(_fget_on, _fset_on, doc='whether or not the stimulus is displayed')

Not sure what the lazy_import issue is, but extending the class using textbox.TextBox seems to work, like this:

from psychopy.visual import textbox

class TextboxSub(textbox.TextBox):
    def __init__(self, window, text, **kwargs):
        super(TextboxSub, self).__init__(window, text, **kwargs)

in use:

from psychopy import visual, core, event
from psychopy.visual import textbox

class TextboxSub(textbox.TextBox):
    def __init__(self, window, text, **kwargs):
        super(TextboxSub, self).__init__(window, text, **kwargs)

fm = textbox.getFontManager()
print("available_font_names:",fm.getFontFamilyNames())

# Create Window
window=visual.Window((800,600),
                        units='norm',
                        fullscr=False, allowGUI=True,
                        screen=0
                        )

sometext='PRESS ANY KEY TO QUIT DEMO.'
textbox1=TextboxSub(window=window,
                         text=sometext,
                         font_name=fm.getFontFamilyNames()[0],
                         font_size=21,
                         font_color=[-1,-1,1],
                         size=(1.9,.3),
                         pos=(0.0,0.25),
                         grid_horz_justification='center',
                         units='norm',
                         )

textbox1.draw()
event.clearEvents()
while True:
    textbox1.draw()

    # Update the display to show any stim changes
    flip_time=window.flip()

    kb_events=event.getKeys()
    if kb_events:
        break

core.quit()