ID:2223961
 
(See the best response by Flick.)
Code:
                var/list/tempHouseCards = typesof("/obj/House_Cards/[player.House]")


Problem description:

I want all the children of /obj/House_Cards/[player.House] in the list, but not /obj/House_Cards/[player.House] itself. What's the best way of achieving this? I'm hesitant to loop through the list and check istype() on all entries.
var/list/tempHouseCards = typesof("/obj/House_Cards/[player.House]")-/obj/House_Cards


typesof returns a list, so literally just subtract that item from the list
That is what I'd normally do, but the type I want to remove is based on the player.House var. I.e., it could be /obj/House_Cards/Stark or /obj/House_Cards/Greyjoy.
Best response
var/list/L = typesof("/obj/House_Cards/[player.House]")-text2path("/obj/House_Cards/[player.House]")
Ah, perfect. Thank you Flick.
In response to Flick
Flick wrote:
var/list/L = typesof("/obj/House_Cards/[player.House]")-text2path("/obj/House_Cards/[player.House]")


I wonder if you even need to use text2path there.
Yep. Must treat it as trying to remove an actual text string otherwise. You don't need it in the typesof call since typesof knows it's looking for type paths. But when you are subtracting from a list, the system doesn't know if you actually are looking for paths or strings.
BTW, an even easier method would be a two-var solution:

var/tp = text2path("/obj/House_Cards/[player.House]")
var/list/L = typesof(tp) - tp

It's easier to read and it basically avoids calling text2path() (internally) twice. Although text2path caches its results, so it'll be faster on the second call anyway. Mostly what you get out of this is readability.
Cheers Lummox. Always keen to improve readability.