Create Code Object reference to itself?

I have been messing about with python bytecode and I wanted to create a recursive function directly, to do this I can create a Code Object and within the constants tuple, I need a reference to itself. The issue comes in with the fact that the code objects constants attribute is read-only. Is there any way to get around this? (perhaps by using some hacky c code or something? I did try looking into this but I haven’t found anything so far)

Here is an example of what I am trying to achieve:

from types import CodeType #get code type constructor                                                                                                                                  

#build a test object with 0 constants
test_obj = CodeType(                                                                   
#try to change the constants tuple to include itself
test_obj.co_consts = test_obj.co_consts + (test_obj,)                          
#this creates this error AttributeError: readonly attribute