public static struct_time __new__(CodeContext context, PythonType cls, int year, int month, int day, int hour, int minute, int second, int dayOfWeek, int dayOfYear, int isDst) { if (cls == _StructTimeType) { return(new struct_time(year, month, day, hour, minute, second, dayOfWeek, dayOfYear, isDst)); } else { struct_time st = cls.CreateInstance(context, year, month, day, hour, minute, second, dayOfWeek, dayOfYear, isDst) as struct_time; if (st == null) { throw PythonOps.TypeError("{0} is not a subclass of time.struct_time", cls); } return(st); } }
public static struct_time __new__(CodeContext context, PythonType cls, [NotNull] PythonTuple sequence) { if (sequence.__len__() != 9) { throw PythonOps.TypeError("time.struct_time() takes a 9-sequence ({0}-sequence given)", sequence.__len__()); } if (cls == _StructTimeType) { return(new struct_time(sequence)); } else { struct_time st = cls.CreateInstance(context, sequence) as struct_time; if (st == null) { throw PythonOps.TypeError("{0} is not a subclass of time.struct_time", cls); } return(st); } }