Skip to content

Commit 0ac7140

Browse files
author
Michael Folkerts
committed
added type hints in comments
1 parent bdddd02 commit 0ac7140

29 files changed

+34989
-4141
lines changed

pyesapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from .stubs.System.Collections.Generic import Dictionary
4545

4646
# for numpy array interfacing
47-
from .stubs.System.Windows import Point
47+
# from .stubs.System.Windows import Point
4848
from .stubs.System import Array, Int32, Double
4949
# from .stubs.System.Runtime.InteropServices import GCHandle, GCHandleType # TODO: these are missing from type stubs
5050

pyesapi/stubs/Microsoft/CSharp.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class CSharpCodeProvider(CodeDomProvider, IComponent, IDisposable):
1616
CSharpCodeProvider(providerOptions: IDictionary[str, str])
1717
"""
1818
def CreateCompiler(self):
19+
# type: (self: CSharpCodeProvider) -> ICodeCompiler
1920
"""
2021
CreateCompiler(self: CSharpCodeProvider) -> ICodeCompiler
2122
@@ -25,6 +26,7 @@ def CreateCompiler(self):
2526
pass
2627

2728
def CreateGenerator(self, *__args):
29+
# type: (self: CSharpCodeProvider) -> ICodeGenerator
2830
"""
2931
CreateGenerator(self: CSharpCodeProvider) -> ICodeGenerator
3032
@@ -34,6 +36,7 @@ def CreateGenerator(self, *__args):
3436
pass
3537

3638
def Dispose(self):
39+
# type: (self: Component, disposing: bool)
3740
"""
3841
Dispose(self: Component, disposing: bool)
3942
Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources.
@@ -43,6 +46,7 @@ def Dispose(self):
4346
pass
4447

4548
def GenerateCodeFromMember(self, member, writer, options):
49+
# type: (self: CSharpCodeProvider, member: CodeTypeMember, writer: TextWriter, options: CodeGeneratorOptions)
4650
"""
4751
GenerateCodeFromMember(self: CSharpCodeProvider, member: CodeTypeMember, writer: TextWriter, options: CodeGeneratorOptions)
4852
Generates code for the specified class member using the specified text writer and code generator options.
@@ -54,6 +58,7 @@ def GenerateCodeFromMember(self, member, writer, options):
5458
pass
5559

5660
def GetConverter(self, type):
61+
# type: (self: CSharpCodeProvider, type: Type) -> TypeConverter
5762
"""
5863
GetConverter(self: CSharpCodeProvider, type: Type) -> TypeConverter
5964
@@ -65,26 +70,26 @@ def GetConverter(self, type):
6570
pass
6671

6772
def GetService(self, *args): #cannot find CLR method
73+
# type: (self: Component, service: Type) -> object
6874
"""
6975
GetService(self: Component, service: Type) -> object
7076
7177
Returns an object that represents a service provided by the System.ComponentModel.Component or by its System.ComponentModel.Container.
7278
7379
service: A service provided by the System.ComponentModel.Component.
74-
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component, or null if the System.ComponentModel.Component does not provide
75-
the specified service.
80+
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component, or null if the System.ComponentModel.Component does not provide the specified service.
7681
"""
7782
pass
7883

7984
def MemberwiseClone(self, *args): #cannot find CLR method
85+
# type: (self: MarshalByRefObject, cloneIdentity: bool) -> MarshalByRefObject
8086
"""
8187
MemberwiseClone(self: MarshalByRefObject, cloneIdentity: bool) -> MarshalByRefObject
8288
8389
Creates a shallow copy of the current System.MarshalByRefObject object.
8490
85-
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity, which will cause the object to be assigned a new identity when it is marshaled
86-
across a remoting boundary. A value of false is usually appropriate. true to copy the current System.MarshalByRefObject object's identity to its clone,
87-
which will cause remoting client calls to be routed to the remote server object.
91+
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity, which will cause the object to be assigned a new identity when it is marshaled across a remoting boundary. A value of false is usually appropriate. true to copy the current
92+
System.MarshalByRefObject object's identity to its clone, which will cause remoting client calls to be routed to the remote server object.
8893
8994
Returns: A shallow copy of the current System.MarshalByRefObject object.
9095
MemberwiseClone(self: object) -> object
@@ -118,26 +123,20 @@ def __str__(self, *args): #cannot find CLR method
118123
pass
119124

120125
CanRaiseEvents = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
121-
"""Gets a value indicating whether the component can raise an event.
122-
123-
"""
126+
""" Gets a value indicating whether the component can raise an event. """
124127

125128
DesignMode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
126-
"""Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode.
127-
128-
"""
129+
""" Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode. """
129130

130131
Events = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
131-
"""Gets the list of event handlers that are attached to this System.ComponentModel.Component.
132-
133-
"""
132+
""" Gets the list of event handlers that are attached to this System.ComponentModel.Component. """
134133

135134
FileExtension = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
136-
"""Gets the file name extension to use when creating source code files.
137-
138-
Get: FileExtension(self: CSharpCodeProvider) -> str
139-
140-
"""
135+
"""
136+
Gets the file name extension to use when creating source code files.
137+
138+
Get: FileExtension(self: CSharpCodeProvider) -> str
139+
"""
141140

142141

143142

pyesapi/stubs/Microsoft/VisualBasic.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class VBCodeProvider(CodeDomProvider, IComponent, IDisposable):
1616
VBCodeProvider(providerOptions: IDictionary[str, str])
1717
"""
1818
def CreateCompiler(self):
19+
# type: (self: VBCodeProvider) -> ICodeCompiler
1920
"""
2021
CreateCompiler(self: VBCodeProvider) -> ICodeCompiler
2122
@@ -25,6 +26,7 @@ def CreateCompiler(self):
2526
pass
2627

2728
def CreateGenerator(self, *__args):
29+
# type: (self: VBCodeProvider) -> ICodeGenerator
2830
"""
2931
CreateGenerator(self: VBCodeProvider) -> ICodeGenerator
3032
@@ -34,6 +36,7 @@ def CreateGenerator(self, *__args):
3436
pass
3537

3638
def Dispose(self):
39+
# type: (self: Component, disposing: bool)
3740
"""
3841
Dispose(self: Component, disposing: bool)
3942
Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources.
@@ -43,6 +46,7 @@ def Dispose(self):
4346
pass
4447

4548
def GenerateCodeFromMember(self, member, writer, options):
49+
# type: (self: VBCodeProvider, member: CodeTypeMember, writer: TextWriter, options: CodeGeneratorOptions)
4650
"""
4751
GenerateCodeFromMember(self: VBCodeProvider, member: CodeTypeMember, writer: TextWriter, options: CodeGeneratorOptions)
4852
Generates code for the specified class member using the specified text writer and code generator options.
@@ -54,6 +58,7 @@ def GenerateCodeFromMember(self, member, writer, options):
5458
pass
5559

5660
def GetConverter(self, type):
61+
# type: (self: VBCodeProvider, type: Type) -> TypeConverter
5762
"""
5863
GetConverter(self: VBCodeProvider, type: Type) -> TypeConverter
5964
@@ -65,26 +70,26 @@ def GetConverter(self, type):
6570
pass
6671

6772
def GetService(self, *args): #cannot find CLR method
73+
# type: (self: Component, service: Type) -> object
6874
"""
6975
GetService(self: Component, service: Type) -> object
7076
7177
Returns an object that represents a service provided by the System.ComponentModel.Component or by its System.ComponentModel.Container.
7278
7379
service: A service provided by the System.ComponentModel.Component.
74-
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component, or null if the System.ComponentModel.Component does not provide
75-
the specified service.
80+
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component, or null if the System.ComponentModel.Component does not provide the specified service.
7681
"""
7782
pass
7883

7984
def MemberwiseClone(self, *args): #cannot find CLR method
85+
# type: (self: MarshalByRefObject, cloneIdentity: bool) -> MarshalByRefObject
8086
"""
8187
MemberwiseClone(self: MarshalByRefObject, cloneIdentity: bool) -> MarshalByRefObject
8288
8389
Creates a shallow copy of the current System.MarshalByRefObject object.
8490
85-
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity, which will cause the object to be assigned a new identity when it is marshaled
86-
across a remoting boundary. A value of false is usually appropriate. true to copy the current System.MarshalByRefObject object's identity to its clone,
87-
which will cause remoting client calls to be routed to the remote server object.
91+
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity, which will cause the object to be assigned a new identity when it is marshaled across a remoting boundary. A value of false is usually appropriate. true to copy the current
92+
System.MarshalByRefObject object's identity to its clone, which will cause remoting client calls to be routed to the remote server object.
8893
8994
Returns: A shallow copy of the current System.MarshalByRefObject object.
9095
MemberwiseClone(self: object) -> object
@@ -118,33 +123,27 @@ def __str__(self, *args): #cannot find CLR method
118123
pass
119124

120125
CanRaiseEvents = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
121-
"""Gets a value indicating whether the component can raise an event.
122-
123-
"""
126+
""" Gets a value indicating whether the component can raise an event. """
124127

125128
DesignMode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
126-
"""Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode.
127-
128-
"""
129+
""" Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode. """
129130

130131
Events = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
131-
"""Gets the list of event handlers that are attached to this System.ComponentModel.Component.
132-
133-
"""
132+
""" Gets the list of event handlers that are attached to this System.ComponentModel.Component. """
134133

135134
FileExtension = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
136-
"""Gets the file name extension to use when creating source code files.
137-
138-
Get: FileExtension(self: VBCodeProvider) -> str
139-
140-
"""
135+
"""
136+
Gets the file name extension to use when creating source code files.
137+
138+
Get: FileExtension(self: VBCodeProvider) -> str
139+
"""
141140

142141
LanguageOptions = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
143-
"""Gets a language features identifier.
144-
145-
Get: LanguageOptions(self: VBCodeProvider) -> LanguageOptions
146-
147-
"""
142+
"""
143+
Gets a language features identifier.
144+
145+
Get: LanguageOptions(self: VBCodeProvider) -> LanguageOptions
146+
"""
148147

149148

150149

0 commit comments

Comments
 (0)