diff --git a/crates/erg_compiler/lib/pystd/collections.d/abc.d.er b/crates/erg_compiler/lib/pystd/collections.d/abc.d.er index 75c3ac10..3ee5bfa9 100644 --- a/crates/erg_compiler/lib/pystd/collections.d/abc.d.er +++ b/crates/erg_compiler/lib/pystd/collections.d/abc.d.er @@ -1,37 +1,70 @@ # The ABCs in this file are not defined as a collection of traits. # Use `std/abc` instead. .Container: ClassType +.Container. + __getitem__: (ty := Type) -> Type +.Generator: ClassType +.Generator. + __getitem__: (t: (Type, Type, Type)) -> Type .Hashable: ClassType .Sized: ClassType .Callable: ClassType .Callable. - __getitem__: (params: [Type; _], Type) -> Type + __getitem__: (Type or HomogenousTuple(Type), Type) -> Type .Iterable: ClassType .Iterable. - __getitem__: Type -> Type + __getitem__: (ty := Type) -> Type .Collection: ClassType +.Collection. + __getitem__: (ty := Type) -> Type .Iterator: ClassType .Iterator. - __getitem__: Type -> Type + __getitem__: (ty := Type) -> Type .Reversible: ClassType -.Genertor: ClassType .Sequence: ClassType .Sequence. - __getitem__: Type -> Type + __getitem__: (ty := Type) -> Type .MutableSequence: ClassType +.MutableSequence. + __getitem__: (ty := Type) -> Type +.MutableSet: ClassType +.MutableSet. + __getitem__: (ty := Type) -> Type .ByteString: ClassType .Set: ClassType -.MutableSet: ClassType +.Set. + __getitem__: (ty := Type) -> Type .Mapping: ClassType .Mapping. - __getitem__: (Type, Type) -> Type + __getitem__: (kv: (Type, Type)) -> Type .MutableMapping: ClassType +.MutableMapping. + __getitem__: (kv: (Type, Type)) -> Type .MappingView: ClassType .ItemsView: ClassType .KeysView: ClassType .ValuesView: ClassType .Awaitable: ClassType +.Awaitable. + __getitem__: (ty := Type) -> Type .Coroutine: ClassType +.Coroutine. + __getitem__: (t := (Type, Type, Type)) -> Type .AsyncIterable: ClassType +.AsyncIterable. + __getitem__: (ty := Type) -> Type .AsyncIterator: ClassType +.AsyncIterator. + __getitem__: (ty := Type) -> Type .AsyncGenerator: ClassType +.AsyncGenerator. + __getitem__: (t := (Type, Type, Type)) -> Type +.ContextManager: ClassType +.ContextManager. + __enter__: (self: ContextManager) -> ContextManager + __exit__: (self: ContextManager, exc_type: Type, exc_value: Obj, traceback: Obj) -> NoneType +.AsyncContextManager: ClassType +.AsyncContextManager. + __aenter__: (self: AsyncContextManager) -> AsyncContextManager + __aexit__: (self: AsyncContextManager, exc_type: Type, exc_value: Obj, traceback: Obj) -> NoneType +.Buffer: ClassType diff --git a/crates/erg_compiler/lib/pystd/typing.d.er b/crates/erg_compiler/lib/pystd/typing.d.er index 234e7581..67776dd1 100644 --- a/crates/erg_compiler/lib/pystd/typing.d.er +++ b/crates/erg_compiler/lib/pystd/typing.d.er @@ -1,3 +1,38 @@ +{ + .Callable; + .Collection; + .Container; + .ItemsView; + .KeysView; + .ValuesView; + .Iterable; + .Iterator; + .MutableSet; + .Mapping; + .MappingView; + .MutableMapping; + .Sequence; + .MutableSequence; + .Coroutine; + .AsyncIterable; + .AsyncIterator; + .AsyncGenerator; + .Awaitable; + .Generator; + .Hashable; + .Reversible; + .Sized; + .ContextManager; + .AsyncContextManager; +} = pyimport "collections/abc" +{ + .DefaultDict; + .OrderedDict!; + .ChainMap; + .Counter!; + .Deque!; +} = pyimport "collections" + .TYPE_CHECKING: Bool .Any: ClassType @@ -15,9 +50,6 @@ .Optional: ClassType .Optional. __getitem__: (Type or HomogenousTuple Type) -> Type -.Callable: ClassType -.Callable. - __getitem__: (Type or HomogenousTuple Type) -> Type .Concatenate: (*Type) -> Type .Type: (Type) -> Type .Literal: ClassType @@ -79,15 +111,6 @@ .FrozenSet: (Type) -> ClassType .FrozenSet. __getitem__: Type -> Type -.OrderedDict: (Type, Type) -> ClassType -.OrderedDict. - __getitem__: (kv: (Type, Type)) -> Type -.ChainMap: (Type, Type) -> Type -.Counter: (Type, Int) -> Type -.Deque: (T: Type) -> ClassType -.Deque. - __call__: |T|(iter: global::Iterable(T)) -> Deque T - __getitem__: (Type) -> Type .IO: Type -> ClassType .IO. __call__: () -> IO Obj @@ -103,9 +126,6 @@ .Pattern: ClassType .Match: ClassType .Text: ClassType -.Sequence: ClassType -.Sequence. - __getitem__: (Type) -> Type .assert_never: (arg: Obj) -> NoneType .assert_type: (val: Obj, typ: Type) -> NoneType @@ -129,56 +149,6 @@ .AbstractSet. __getitem__: (Type) -> Type .ByteString: ClassType -.Container: ClassType -.ContextManager: ClassType -.ContextManager. - __enter__: (self: ContextManager) -> ContextManager - __exit__: (self: ContextManager, exc_type: Type, exc_value: Obj, traceback: Obj) -> NoneType -.Hashable: ClassType -.ItemsView: ClassType -.Iterable: ClassType -.Iterable. - __getitem__: Type -> Type -.Iterator: ClassType -.Iterator. - __getitem__: Type -> Type -.KeysView: ClassType -.Mapping: ClassType -.Mapping. - __getitem__: (kv: (Type, Type)) -> Type -.MappingView: ClassType -.MappingView. - __getitem__: (Type) -> Type -.MutableMapping: ClassType -.MutableMapping. - __getitem__: (kv: (Type, Type)) -> Type -.MutableSequence: ClassType -.MutableSequence. - __getitem__: Type -> Type -.MutableSet: ClassType -.MutableSet. - __getitem__: Type -> Type -.Sized: ClassType -.ValuesView: ClassType -.Awaitable: ClassType -.AsyncIterator: ClassType -.AsyncIterator. - __getitem__: Type -> Type -.AsyncIterable: ClassType -.AsyncIterable. - __getitem__: Type -> Type -.Coroutine: ClassType -.Coroutine. - __getitem__: (t: (Type, Type, Type)) -> Type -.Collection: ClassType -.Collection. - __getitem__: Type -> Type -.AsyncGenerator: ClassType -.AsyncGenerator. - __getitem__: (t: (Type, Type)) -> Type -.AsyncContextManager: ClassType -.AsyncContextManager. - __getitem__: Type -> Type .SupportsAbs: ClassType .SupportsBytes: ClassType .SupportsComplex: ClassType @@ -186,10 +156,3 @@ .SupportsIndex: ClassType .SupportsInt: ClassType .SupportsRound: ClassType - -.Generator: ClassType -.Generator. - __getitem__: (t: (Type, Type, Type)) -> Type -.Reversible: ClassType -.Reversible. - __getitem__: Type -> Type