Self Inspection of VB6 UDTs

Contrary to what others have said, it IS possible to get run-time type information for UDT’s in VB6 (although it is not a built-in language feature). Microsoft’s TypeLib Information Object Library (tlbinf32.dll) allows you to programmatically inspect COM type information at run-time. You should already have this component if you have Visual Studio installed: to … Read more

SQL Server 2008 – How do i return a User-Defined Table Type from a Table-Valued Function?

Even though you can not return the UDTT from a function, you can return a table variable and receive it in a UDTT as long as the schema match. The following code is tested in SQL Server 2008 R2 — Create the UDTT CREATE TYPE dbo.MyCustomUDDT AS TABLE ( FieldOne varchar (512), FieldTwo varchar(1024) ) … Read more

Type hints with user defined classes

The former is correct, if arg accepts an instance of CustomClass: def FuncA(arg: CustomClass): # ^ instance of CustomClass In case you want the class CustomClass itself (or a subtype), then you should write: from typing import Type # you have to import Type def FuncA(arg: Type[CustomClass]): # ^ CustomClass (class object) itself Like it … Read more