Example #1
0
 /// <summary>
 /// Creates type info for an collection.
 /// </summary>
 /// <param name="collectionTypeId">Collection type id, such as <see cref="BuiltinTypeId.List"/>.</param>
 /// <param name="declaringModule">Declaring module.</param>
 /// <param name="isMutable">Indicates if collection is mutable (like list) or immutable (like tuple).</param>
 public PythonCollectionType(
     BuiltinTypeId collectionTypeId,
     IPythonModule declaringModule,
     bool isMutable
     ) : base(collectionTypeId, declaringModule)
 {
     TypeId       = collectionTypeId;
     IteratorType = new PythonIteratorType(collectionTypeId.GetIteratorTypeId(), declaringModule);
     IsMutable    = isMutable;
 }
Example #2
0
 /// <summary>
 /// Creates type info for an collection.
 /// </summary>
 /// <param name="typeName">Iterable type name. If null, name of the type id will be used.</param>
 /// <param name="collectionTypeId">Collection type id, such as <see cref="BuiltinTypeId.List"/>.</param>
 /// <param name="interpreter">Python interpreter.</param>
 /// <param name="isMutable">Indicates if collection is mutable (like list) or immutable (like tuple).</param>
 public PythonCollectionType(
     string typeName,
     BuiltinTypeId collectionTypeId,
     IPythonInterpreter interpreter,
     bool isMutable
     ) : base(collectionTypeId, interpreter.ModuleResolution.BuiltinsModule)
 {
     _typeName    = typeName;
     TypeId       = collectionTypeId;
     IteratorType = new PythonIteratorType(collectionTypeId.GetIteratorTypeId(), interpreter);
     IsMutable    = isMutable;
 }