How to cast result of spawn_and_register_tab in Python

I’d like to be able to spawn an EditorUtilityWidget from Python and then call functions or set properties on it. In Blueprint it works – like so:

In Python, however, I can’t seem to figure out how to cast the return value of spawn_and_register_tab back to the correct class. The following spawns the widget tab correctly

import unreal

fred_asset  = unreal.EditorAssetLibrary.load_asset('/Game/fred.fred')
eus = unreal.get_editor_subsystem(unreal.EditorUtilitySubsystem)
tab = eus.spawn_and_register_tab(fred_asset)

but there does not seem to be a way to get access to the derived class (‘fred’) to apply a cast to the return value. I’d have expected it to be

fred_asset.cast(tab)

but that errors with

Cannot cast type 'EditorUtilityWidget' to 'EditorUtilityWidgetBlueprint'

So – what’s the correct incantation to get the equivalent of the blueprint snippet above?

pretty sure u already found the solution,
for people who are into this, actually is not a big issue.

just take the python outout and set directly to a variable “Editor Utility Widget”, later you can cast into your Blueprint widget.

remember that the output is an array of tab and id. If you need tahe tab output [0], and output the id as string [1].

All tat using Execute ython Script Node