### Silly Setup for Doctest Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/test/test_doctest2.txt Imports the doctest module and accesses a setup variable. This is a prerequisite for subsequent tests. ```python >>> import test.test_doctest >>> test.test_doctest.sillySetup True ``` -------------------------------- ### Build with Specific Configuration and Platform Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/building.md Use the -configuration and -platform options with make.ps1 to specify build settings. For example, to build a release x64 version. ```powershell .\make.ps1 -configuration release -platform x64 ``` -------------------------------- ### GetEntryAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the process executable in the default application domain. ```APIDOC ## GetEntryAssembly ### Description Gets the process executable in the default application domain. In other application domains, this is the first executable that was executed by System.AppDomain.ExecuteAssembly(System.String). ### Method [Assembly](#Assembly) GetEntryAssembly() ### Returns The [Assembly] that is the process executable in the default application domain, or the first executable that was executed by System.AppDomain.ExecuteAssembly(System.String). Can return null when called from unmanaged code. ``` -------------------------------- ### Assembly.GetEntryAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the process executable in the default application domain. ```APIDOC ## Assembly.GetEntryAssembly ### Description Gets the process executable in the default application domain. In other application domains, this is the first executable that was executed by System.AppDomain.ExecuteAssembly(System.String). ### Method (Not specified, likely a static method) ### Parameters (None specified) ### Returns The Assembly that is the process executable in the default application domain, or the first executable that was executed by System.AppDomain.ExecuteAssembly(System.String). Can return null when called from unmanaged code. ``` -------------------------------- ### Configure Git User and Branch Settings Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/getting-the-sources.md Set global Git configurations for automatic branch setup, username, and email before cloning. ```bash git config --global branch.autosetupmerge true git config --global user.name "Jane Doe" git config --global user.email janedoe@example.com ``` -------------------------------- ### Get Delegate Method Information Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Gets the method represented by the delegate. This returns a MethodInfo object. ```Python delegate.Method() ``` -------------------------------- ### Hello World in C# Source: https://github.com/ironlanguages/ironpython2/blob/master/README.md A basic 'Hello World' program in C#. ```cs using System; class Hello { static void Main() { Console.WriteLine("Hello World"); } } ``` -------------------------------- ### Get Delegate Target Instance Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Gets the class instance on which the delegate invokes the instance method. This returns the object instance the delegate is bound to. ```Python delegate.Target() ``` -------------------------------- ### EntryPoint Property Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Returns the entry point of this assembly. ```APIDOC ## EntryPoint Property ### Description Returns the entry point of this assembly. ### Get MethodInfo EntryPoint(self) ``` -------------------------------- ### Example of a leak function with cyclic garbage handling Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/test/leakers/README.txt This example demonstrates how to define a leak function that also handles cyclic garbage. It includes nested functions and multiple garbage collection calls to ensure thorough cleanup. ```python def leak(): def inner_leak(): # this is the function that leaks, but also creates cycles inner_leak() gc.collect() ; gc.collect() ; gc.collect() ``` -------------------------------- ### ClassBase Constructor Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Initializes a ClassBase instance. ```APIDOC ## ClassBase ### Description Initializes a ClassBase instance. ### Method N/A (Constructor) ### Parameters None ``` -------------------------------- ### Delegate.Method Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_defaultmember.html Gets the method represented by the delegate. ```APIDOC ## Delegate.Method ### Description Gets the method represented by the delegate. ### Method MethodInfo Method(self) ### Returns MethodInfo - The method represented by the delegate. ``` -------------------------------- ### Target Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.property.test_indexercs.html Gets the target object of the delegate. ```APIDOC ## Target ### Description Gets the target object of the delegate. ### Returns - **object** - The target object of the delegate. ``` -------------------------------- ### C Constructor Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Initializes a C class instance. ```APIDOC ## C ### Description Initializes a C class instance. ### Method N/A (Constructor) ### Parameters None ``` -------------------------------- ### UInt16VoidDelegate Constructors Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Provides information on how to instantiate a UInt16VoidDelegate. ```APIDOC ## UInt16VoidDelegate Constructor ### Description Instantiates a new UInt16VoidDelegate. ### Method `__new__` ### Parameters - **cls**: The class itself. - **object**: The target object. - **method**: A pointer to the method. ``` -------------------------------- ### Arg3 Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets the Arg3 property. ```APIDOC ## Arg3 ### Description Gets or sets the Arg3 property. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (int) - The value to set for the property. ``` -------------------------------- ### StringProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a string property. ```APIDOC ## StringProperty ### Description Gets or sets a string property. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (str) - The value to set for the property. ``` -------------------------------- ### Registering a COM Server Class Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/site-packages/win32com/HTML/QuickStartServerCom.html Use this idiom to register your Python COM server when it's run as a script. It leverages the standard Python entry point. ```python if __name__=='__main__': # ni only for 1.4! import ni, win32com.server.register win32com.server.register.UseCommandLine(HelloWorld) ``` -------------------------------- ### IntProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets an integer property. ```APIDOC ## IntProperty ### Description Gets or sets an integer property. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (int) - The value to set for the property. ``` -------------------------------- ### NotEqualOp.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_operators.html Creates a new instance of NotEqualOp. ```APIDOC ## NotEqualOp.__new__ ### Description Creates a new instance of NotEqualOp. ### Method __new__ ### Parameters - **cls**: type - The class itself. - **value**: int - The integer value to initialize the NotEqualOp object with. ``` -------------------------------- ### Instantiate and Use a COM Object Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/site-packages/win32com/HTML/QuickStartClientCom.html Import the win32com.client module to create and interact with COM objects. This example shows basic method calls and property assignments. ```Python import win32com.client o = win32com.client.Dispatch("Object.Name") o.Method() o.property = "New Value" print o.property ``` -------------------------------- ### BoolProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a boolean property. ```APIDOC ## BoolProperty ### Description Gets or sets a boolean property. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (bool) - The value to set for the property. ``` -------------------------------- ### Method Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_event_override.html Gets the method represented by the delegate. ```APIDOC ## Method ### Description Gets the method represented by the delegate. ### Method MethodInfo Method(self) ### Parameters #### Path Parameters - **self** (Delegate) - The delegate instance. ### Returns The MethodInfo of the delegate. ``` -------------------------------- ### Assembly.CreateInstance (Full Overload) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Locates and creates an instance of a specified type from this assembly using the system activator. This overload provides extensive control over the creation process, including case sensitivity, binding attributes, binder, arguments, culture, and activation attributes. ```APIDOC ## Assembly.CreateInstance (Full Overload) ### Description Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes. ### Method Assembly.CreateInstance ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **typeName** (str) - The System.Type.FullName of the type to locate. * **ignoreCase** (bool) - true to ignore the case of the type name; otherwise, false. * **bindingAttr** (BindingFlags) - A bitmask that affects the way in which the search is conducted. The value is a combination of bit flags from System.Reflection.BindingFlags. * **binder** (Binder) - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. * **args** (Array[object]) - An array of type Object containing the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, args must be an empty array or null. * **culture** (CultureInfo) - An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. * **activationAttributes** (Array[object]) - An array of one or more attributes that can participate in activation. Typically, an array that contains a single System.Runtime.Remoting.Activation.UrlAttribute. The System.Runtime.Remoting.Activation.UrlAttribute specifies the URL that is required to activate a remote object. For a detailed description of client-activated objects, see Client Activation. ### Returns An instance of Object representing the type and matching the specified criteria, or null if typeName is not found. ``` -------------------------------- ### GetTypes Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the types defined in this assembly. ```APIDOC ## GetTypes ### Description Gets the types defined in this assembly. ### Method (Not specified, likely a method call) ### Parameters None ### Returns An array of type System.Type containing objects for all the types defined in this assembly. ``` -------------------------------- ### Stage Files for Packaging Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/building.md Use the 'stage' target to prepare files for the packaging process. This command is run from the root of the source directory. ```powershell .\make.ps1 stage ``` -------------------------------- ### GetModule Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the specified module in this assembly. ```APIDOC ## GetModule ### Description Gets the specified module in this assembly. ### Method Module GetModule(self, str name) ### Parameters #### Path Parameters - **name** (str) - The name of the module being requested. ### Returns The module being requested, or null if the module is not found. ``` -------------------------------- ### M450 Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Tests the constructor M450 with integer and dictionary arguments. ```APIDOC ## M450 ### Description Tests the constructor M450 with integer and dictionary arguments. ### Method N/A (Constructor) ### Parameters * **arg1** (int) - Description not available * **arg2** (dict) - Description not available ### Return Value * **int** - Description not available ``` -------------------------------- ### GetExportedTypes Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets all the types that are exported by this assembly. ```APIDOC ## GetExportedTypes ### Description Gets the exported types defined in this assembly. ### Method Array[Type] GetExportedTypes() ### Returns An array of System.Type containing the exported types defined in this assembly. ``` -------------------------------- ### SimpleClass.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_operators.html Creates a new instance of SimpleClass. ```APIDOC ## SimpleClass.__new__ ### Description Creates a new instance of SimpleClass. ### Method __new__ ### Parameters - **cls**: type - The class itself. - **arg**: int - The integer argument to initialize the SimpleClass object with. ``` -------------------------------- ### Int16VoidDelegate.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Creates a new instance of the Int16VoidDelegate. ```APIDOC ## Int16VoidDelegate.__new__ ### Description Creates a new instance of the `Int16VoidDelegate` class. ### Parameters - **cls** (type) - The class type. - **object** (object) - The target object. - **method** (IntPtr) - A pointer to the method. ``` -------------------------------- ### GetTypes Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the types defined in this assembly. ```APIDOC ## GetTypes() ### Description Gets the types defined in this assembly. ### Returns An array of type System.Type containing objects for all the types defined in this assembly. ``` -------------------------------- ### Raising a COM Exception with Details Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/site-packages/win32com/HTML/QuickStartServerCom.html Use the COMException class to provide rich exception information to the COM client. This includes scode, description, helpfile, and helpcontext. ```python raise COMException(desc="Must be a string",scode=winerror.E_INVALIDARG,helpfile="myhelp.hlp",...) ``` -------------------------------- ### Method Property Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Gets the method represented by the delegate. ```APIDOC ## Method ### Description Gets the method represented by the delegate. ### Get MethodInfo Method(self) ``` -------------------------------- ### StructProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a property of type SimpleStruct. ```APIDOC ## StructProperty ### Description Gets or sets a property of type SimpleStruct. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (SimpleStruct) - The value to set for the property. ``` -------------------------------- ### ObjectProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a property of type object. ```APIDOC ## ObjectProperty ### Description Gets or sets a property of type object. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (object) - The value to set for the property. ``` -------------------------------- ### Initialize Git Submodules Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/getting-the-sources.md Initialize and update submodules, specifically the DLR, after cloning the repository. ```bash git submodule update --init ``` -------------------------------- ### EnumProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a property of type EnumUInt64. ```APIDOC ## EnumProperty ### Description Gets or sets a property of type EnumUInt64. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (EnumUInt64) - The value to set for the property. ``` -------------------------------- ### M451 Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Tests the constructor M451 with integer and dictionary arguments. ```APIDOC ## M451 ### Description Tests the constructor M451 with integer and dictionary arguments. ### Method N/A (Constructor) ### Parameters * **arg1** (int) - Description not available * **arg2** (dict) - Description not available ### Return Value * **int** - Description not available ``` -------------------------------- ### ClassProperty Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Gets or sets a property of type SimpleClass. ```APIDOC ## ClassProperty ### Description Gets or sets a property of type SimpleClass. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **value** (SimpleClass) - The value to set for the property. ``` -------------------------------- ### SimpleClass.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.property.test_indexercs.html Constructs a new instance of the SimpleClass. ```APIDOC ## SimpleClass.__new__ ### Description Constructs a new instance of the SimpleClass. ### Method __new__ ### Endpoint N/A (Method call) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **SimpleClass** - A new instance of SimpleClass. #### Response Example N/A ``` -------------------------------- ### InOutParameters Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Demonstrates methods with in and out parameters. ```APIDOC ## InOutParameters ### Description Demonstrates methods with in and out parameters. ### Methods - `M100(arg)`: A method that takes an integer argument. - `M110()`: A method that returns an integer. - `M120()`: A method that returns an integer. - `__repr__(self)`: Returns a string representation of the object. ``` -------------------------------- ### Assembly.GetCustomAttributes (no attributeType) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets all the custom attributes for this assembly. ```APIDOC ## Assembly.GetCustomAttributes ### Description Gets all the custom attributes for this assembly. ### Method (Not specified, likely an instance method) ### Parameters #### Path Parameters (None specified) #### Query Parameters (None specified) #### Request Body (None specified) ### Parameters * **inherit** (bool) - Ignored - This argument is ignored for objects of type System.Reflection.Assembly. ### Returns An array of type Object containing the custom attributes for this assembly. ``` -------------------------------- ### Count Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_ctor_override.html Gets the number of elements contained in the collection. ```APIDOC ## Count ### Description Gets the number of elements contained in the System.Collections.ICollection. ### Method Get ### Response #### Success Response (int) - **return value** (int) - The number of elements contained in the System.Collections.ICollection. ``` -------------------------------- ### Assembly.LoadFrom Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Loads an assembly given its file name or path, security evidence, hash value, and hash algorithm. ```APIDOC ## Assembly.LoadFrom(str assemblyFile, Evidence securityEvidence, Array[Byte] hashValue, AssemblyHashAlgorithm hashAlgorithm) ### Description Loads an assembly given its file name or path, security evidence, hash value, and hash algorithm. ### Parameters #### Path Parameters - **assemblyFile** (str) - The name or path of the file that contains the manifest of the assembly. - **securityEvidence** (Evidence) - Evidence for loading the assembly. - **hashValue** (Array[Byte]) - The value of the computed hash code. - **hashAlgorithm** (AssemblyHashAlgorithm) - The hash algorithm used for hashing files and for generating the strong name. ### Returns - The loaded assembly. ``` ```APIDOC ## Assembly.LoadFrom(str assemblyFile, Evidence securityEvidence) ### Description Loads an assembly given its file name or path and supplying security evidence. ### Parameters #### Path Parameters - **assemblyFile** (str) - The name or path of the file that contains the manifest of the assembly. - **securityEvidence** (Evidence) - Evidence for loading the assembly. ### Returns - The loaded assembly. ``` ```APIDOC ## Assembly.LoadFrom(str assemblyFile) ### Description Loads an assembly given its file name or path. ### Parameters #### Path Parameters - **assemblyFile** (str) - The name or path of the file that contains the manifest of the assembly. ### Returns - The loaded assembly. ``` -------------------------------- ### GetValue Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_ctor_override.html Gets the value at the specified position in the array. ```APIDOC ## GetValue ### Description Gets the value at the specified position in the array. ### Method GetValue(self, index1, index2) ### Parameters #### Path Parameters - **index1** (Int64) - Required - A 64-bit integer that represents the first-dimension index of the System.Array element to get. - **index2** (Int64) - Required - A 64-bit integer that represents the second-dimension index of the System.Array element to get. ### Returns object - The value at the specified position in the two-dimensional System.Array. --- ### Method GetValue(self, index) ### Parameters #### Path Parameters - **index** (Int64) - Required - A 64-bit integer that represents the index of the System.Array element to get. ### Returns object - The value at the specified position in the one-dimensional System.Array. ``` -------------------------------- ### COM Server Class Registration Annotations Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/site-packages/win32com/HTML/QuickStartServerCom.html Use these class-level annotations to define COM server properties for simplified registration. Ensure the CLSID, ProgID, and description are correctly set. ```Python class HelloWorld: _reg_clsid_ = "{7CC9F362-486D-11D1-BB48-0000E838A65F}" _reg_desc_ = "Python Test COM Server" _reg_progid_ = "Python.TestServer" _public_methods_ = ['Hello'] [same from here] ``` -------------------------------- ### Example: Interacting with Excel Application Source: https://github.com/ironlanguages/ironpython2/blob/master/Src/StdLib/Lib/site-packages/win32com/HTML/QuickStartClientCom.html Demonstrates using the 'Excel.Application' COM object to make Excel visible, add a new workbook, and set a cell's value. Note that Office 97-95 may have slightly different syntax. ```Python o = win32com.client.Dispatch("Excel.Application") o.Visible = 1 o.Workbooks.Add() # for office 97 – 95 a bit different! o.Cells(1,1).Value = "Hello" ``` -------------------------------- ### Delegate Method Property Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_event_override.html Gets the method represented by the delegate. ```APIDOC ## Delegate Method Property ### Description Retrieves the method information for the delegate. ### Method Method ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters for Method(self) - **self** (Delegate) - The delegate instance. ### Request Example None provided. ### Response #### Success Response (200) Returns a MethodInfo object representing the delegate's method. #### Response Example None provided. ``` -------------------------------- ### Assembly.CreateInstance (Simple Overload) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Locates and creates an instance of a specified type from this assembly using the system activator. This overload simplifies the creation process by only requiring the type name and a flag for case-insensitive searching. ```APIDOC ## Assembly.CreateInstance (Simple Overload) ### Description Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search. ### Method Assembly.CreateInstance ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **typeName** (str) - The System.Type.FullName of the type to locate. * **ignoreCase** (bool) - true to ignore the case of the type name; otherwise, false. ### Returns An instance of System.Object representing the type, with culture, arguments, binder, and activation attributes set to null, and System.Reflection.BindingFlags set to Public or Instance, or null if typeName is not found. ``` -------------------------------- ### Get Delegate Method Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.property.test_indexervb.html Retrieves the MethodInfo object for the delegate. ```Python MethodInfo Method(self) ``` -------------------------------- ### Assembly.LoadFrom(string assemblyFile, Evidence securityEvidence) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Loads an assembly given its file name or path and supplying security evidence. ```APIDOC ## Assembly.LoadFrom(string assemblyFile, Evidence securityEvidence) ### Description Loads an assembly given its file name or path and supplying security evidence. ### Method [Method Signature] ### Parameters #### Path Parameters - **assemblyFile** (str) - The name or path of the file that contains the manifest of the assembly. - **securityEvidence** (Evidence) - Evidence for loading the assembly. ### Returns The loaded assembly. ``` -------------------------------- ### GetExecutingAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the assembly that contains the code that is currently executing. ```APIDOC ## GetExecutingAssembly ### Description Gets the assembly that contains the code that is currently executing. ### Method [Assembly](#Assembly) GetExecutingAssembly() ### Returns A System.Reflection.[Assembly] representing the assembly that contains the code that is currently executing. ``` -------------------------------- ### __new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_arguments.html Creates a new instance of the delegate. ```APIDOC ## __new__ ### Description Creates a new instance of the delegate. ### Method `__new__` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **cls**: The class object. * **object**: An object representing the target method. * **method** (IntPtr) - A pointer to the method. ### Response #### Success Response - **__new__**: A new delegate instance. ``` -------------------------------- ### SimpleClass Constructor Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_clr_array.html Initializes a new instance of the SimpleClass. ```APIDOC ## SimpleClass ### Description Initializes a new instance of the SimpleClass. ### Method SimpleClass ### Parameters #### Path Parameters - **arg** (int) - The integer argument for the constructor. ### Returns A new instance of SimpleClass. ``` -------------------------------- ### GetCustomAttributes Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the custom attributes for this assembly as specified by type. ```APIDOC ## GetCustomAttributes ### Description Gets the custom attributes for this assembly as specified by type. ### Method Array[[object]] GetCustomAttributes(self, Type attributeType, bool inherit) ### Parameters #### Path Parameters - **attributeType** (Type) - The System.Type for which the custom attributes are to be returned. - **inherit** (bool) - This argument is ignored for objects of type System.Reflection.Assembly. ### Returns An array of custom attributes. ``` -------------------------------- ### CodeBase Property Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the location of the assembly, as specified originally. ```APIDOC ## CodeBase Property ### Description Gets the location of the assembly, as specified originally (such as in an System.Reflection.AssemblyName object). ### Get str CodeBase(self) ``` -------------------------------- ### ClassOne Constructor Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Demonstrates the constructor for ClassOne, which accepts an integer argument. ```APIDOC ## ClassOne Constructor ### Description Initializes an instance of `ClassOne` with a specified integer value. ### Method Constructor ### Parameters #### Path Parameters - **arg** (int) - Required - The integer value to initialize the class with. ``` -------------------------------- ### GetFile Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets a file from the file table of the manifest of this assembly. ```APIDOC ## GetFile ### Description Gets a System.IO.FileStream for the specified file in the file table of the manifest of this assembly. ### Method FileStream GetFile(string name) ### Parameters #### Path Parameters - **name** (string) - Required - The name of the specified file. ### Returns A System.IO.FileStream for the specified file, or null, if the file is not found. ``` -------------------------------- ### Initialize Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_ctor_override.html Initializes every element of the value-type System.Array by calling the default constructor of the value type. ```APIDOC ## Initialize ### Description Initializes every element of the value-type System.Array by calling the default constructor of the value type. ### Method `Initialize(self)` ### Parameters - **self** - The array instance. ``` -------------------------------- ### CreateInstance Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes. ```APIDOC ## CreateInstance ### Description Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes. ### Method CreateInstance ### Parameters * **typeName** (str) - The System.Type.FullName of the type to locate. * **ignoreCase** (bool) - true to ignore the case of the type name; otherwise, false. * **bindingAttr** (BindingFlags) - A bitmask that affects the way in which the search is conducted. The value is a combination of bit flags from System.Reflection.BindingFlags. * **binder** (Binder) - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. * **args** (Array[object]) - An array of type Object containing the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, args must be an empty array or null. * **culture** (CultureInfo) - An instance of CultureInfo used to govern the coercion of types. If ``` -------------------------------- ### Assembly.GetExportedTypes Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the public types defined in this assembly that are visible. ```APIDOC ## Assembly.GetExportedTypes ### Description Gets the public types defined in this assembly that are visible. ### Method (Not specified, likely an instance method) ### Parameters (None specified) ### Returns An array of Type. ``` -------------------------------- ### Build Debug Binaries from Command Line Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/building.md Run the make.ps1 script with the 'debug' argument to build debug binaries. Ensure you are in the source directory. ```powershell .\make.ps1 debug ``` -------------------------------- ### Assembly.GetExecutingAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the assembly that contains the code that is currently executing. ```APIDOC ## Assembly.GetExecutingAssembly ### Description Gets the assembly that contains the code that is currently executing. ### Method (Not specified, likely a static method) ### Parameters (None specified) ### Returns A System.Reflection.Assembly representing the assembly that contains the code that is currently executing. ``` -------------------------------- ### Hello World in IronPython Source: https://github.com/ironlanguages/ironpython2/blob/master/README.md A basic 'Hello World' program in IronPython. ```py print "Hello World" ``` -------------------------------- ### GetUpperBound Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_ctor_override.html Gets the upper bound of the specified dimension in the System.Array. ```APIDOC ## GetUpperBound ### Description Gets the upper bound of the specified dimension in the System.Array. ### Method GetUpperBound(self, dimension) ### Parameters #### Path Parameters - **dimension** (int) - Required - A zero-based dimension of the System.Array whose upper bound needs to be determined. ### Returns int - The upper bound of the specified dimension in the System.Array. ``` -------------------------------- ### EnumUInt32.__reduce_ex__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.property.test_indexercs.html Helper method for pickling. ```APIDOC ## EnumUInt32.__reduce_ex__ ### Description Helper method for pickling. ### Method __reduce_ex__ ### Parameters None explicitly documented. ``` -------------------------------- ### GetLowerBound Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.derivation.test_ctor_override.html Gets the lower bound of the specified dimension in the System.Array. ```APIDOC ## GetLowerBound ### Description Gets the lower bound of the specified dimension in the System.Array. ### Method GetLowerBound(self, dimension) ### Parameters #### Path Parameters - **dimension** (int) - Required - A zero-based dimension of the System.Array whose lower bound needs to be determined. ### Returns int - The lower bound of the specified dimension in the System.Array. ``` -------------------------------- ### GetValue (3D) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_clr_array.html Gets the value at a specified position in a three-dimensional array. ```APIDOC ## GetValue (3D) ### Description Gets the value at the specified position in the three-dimensional System.Array. The indexes are specified as 64-bit integers. ### Method (Not specified, likely a method call) ### Parameters #### Path Parameters - **index1** (Int64) - Required - A 64-bit integer that represents the first-dimension index of the System.Array element to get. - **index2** (Int64) - Required - A 64-bit integer that represents the second-dimension index of the System.Array element to get. - **index3** (Int64) - Required - A 64-bit integer that represents the third-dimension index of the System.Array element to get. ### Returns - **object** - The value at the specified position in the three-dimensional System.Array. ``` -------------------------------- ### InOutParameters Class Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_ctor.html Demonstrates input and output parameters with various methods. ```APIDOC ## Class: InOutParameters ### Description Demonstrates input and output parameters with various methods. ### Methods - `M100(arg)`: A method that takes an integer argument. - `M110()`: A method that returns an integer. - `M120()`: A method that returns an integer. - `__repr__(self)`: Returns a string representation of the object. ``` -------------------------------- ### GetValue (1D) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_clr_array.html Gets the value at a specified position in a one-dimensional array. ```APIDOC ## GetValue (1D) ### Description Gets the value at the specified position in the one-dimensional System.Array. The index is specified as a 64-bit integer. ### Method (Not specified, likely a method call) ### Parameters #### Path Parameters - **index** (Int64) - Required - A 64-bit integer that represents the position of the System.Array element to get. ### Returns - **object** - The value at the specified position in the one-dimensional System.Array. ``` -------------------------------- ### UInt32VoidDelegate.BeginInvoke Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Begins an asynchronous invocation of the UInt32VoidDelegate. ```APIDOC ## BeginInvoke ### Description Begins an asynchronous invocation of the UInt32VoidDelegate. ### Method IAsyncResult BeginInvoke(self, AsyncCallback callback, object state) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (IAsyncResult) Returns an IAsyncResult object representing the asynchronous operation. #### Response Example None ``` -------------------------------- ### Create Packages Source: https://github.com/ironlanguages/ironpython2/blob/master/Documentation/building.md The 'package' target stages files and creates packages supported by the current platform. This is typically used after building. ```powershell .\make.ps1 package ``` -------------------------------- ### GetValue (2D) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_clr_array.html Gets the value at a specified position in a two-dimensional array. ```APIDOC ## GetValue (2D) ### Description Gets the value at the specified position in the two-dimensional System.Array. The indexes are specified as 64-bit integers. ### Method (Not specified, likely a method call) ### Parameters #### Path Parameters - **index1** (Int64) - Required - A 64-bit integer that represents the first-dimension index of the System.Array element to get. - **index2** (Int64) - Required - A 64-bit integer that represents the second-dimension index of the System.Array element to get. ### Returns - **object** - The value at the specified position in the two-dimensional System.Array. ``` -------------------------------- ### GetValue (multi-dimensional) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_clr_array.html Gets the value at a specified position in a multi-dimensional array. ```APIDOC ## GetValue (multi-dimensional) ### Description Gets the value at the specified position in the multidimensional System.Array. The indexes are specified as an array of 64-bit integers. ### Method (Not specified, likely a method call) ### Parameters #### Path Parameters - **indices** (Array[Int64]) - Required - A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the System.Array element to get. ### Returns - **object** - The value at the specified position in the multidimensional System.Array. ``` -------------------------------- ### Target Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_operators.html Gets the class instance on which the delegate invokes the instance method. ```APIDOC ## Target ### Description Retrieves the instance on which the delegate invokes an instance method. This will be null for static methods. ### Method Delegate ### Parameters #### Self - **self** (Delegate) - The delegate instance. ### Returns - (object) The instance on which the delegate invokes the method, or null if the method is static. ``` -------------------------------- ### CharVoidDelegate.__reduce_ex__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Helper for pickling. ```APIDOC ## CharVoidDelegate.__reduce_ex__ ### Description Helper for pickling. ### Method __reduce_ex__ ### Parameters #### Path Parameters - **self** (CharVoidDelegate) - Required - The delegate instance. ``` -------------------------------- ### GetType Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the System.Type object with the specified name in the assembly instance. ```APIDOC ## GetType (with throwOnError and ignoreCase) ### Description Gets the System.Type object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found. ### Method (Not specified, likely a method call) ### Parameters * **name** (str) - The full name of the type. * **throwOnError** (bool) - true to throw an exception if the type is not found; false to return null. * **ignoreCase** (bool) - true to ignore the case of the type name; otherwise, false. ### Returns A System.Type object that represents the specified class. ``` ```APIDOC ## GetType (with throwOnError) ### Description Gets the System.Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found. ### Method (Not specified, likely a method call) ### Parameters * **name** (str) - The full name of the type. * **throwOnError** (bool) - true to throw an exception if the type is not found; false to return null. ### Returns A System.Type object that represents the specified class. ``` ```APIDOC ## GetType (name only) ### Description Gets the System.Type object with the specified name in the assembly instance. ### Method (Not specified, likely a method call) ### Parameters * **name** (str) - The full name of the type. ### Returns A System.Type object that represents the specified class, or null if the class is not found. ``` -------------------------------- ### Int16VoidDelegate Constructor Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Initializes a new instance of the Int16VoidDelegate class. ```Python __new__(cls, object object, IntPtr method) ``` -------------------------------- ### GetName Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets an System.Reflection.AssemblyName for this assembly, setting the codebase as specified by copiedName. ```APIDOC ## GetName (with copiedName) ### Description Gets an System.Reflection.AssemblyName for this assembly, setting the codebase as specified by copiedName. ### Method AssemblyName GetName(self, bool copiedName) ### Parameters #### Path Parameters - **copiedName** (bool) - true to set the System.Reflection.Assembly.CodeBase to the location of the assembly after it was shadow copied; false to set System.Reflection.Assembly.CodeBase to the original location. ### Returns An System.Reflection.AssemblyName for this assembly. ``` ```APIDOC ## GetName (without copiedName) ### Description Gets an System.Reflection.AssemblyName for this assembly. ### Method AssemblyName GetName(self) ### Returns An System.Reflection.AssemblyName for this assembly. ``` -------------------------------- ### ClassImplementSimpleInterface.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_op_explicit.html Constructor for ClassImplementSimpleInterface. ```APIDOC ## ClassImplementSimpleInterface.__new__ ### Description Constructor for ClassImplementSimpleInterface. ### Method N/A (Method Signature) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Parameters - **cls** (type) - Description not available - **arg** (int) - Description not available ### Response #### Success Response - **return value** (object) - Description not available ### Request Example N/A ### Response Example N/A ``` -------------------------------- ### GetAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the currently loaded assembly in which the specified class is defined. ```APIDOC ## GetAssembly ### Description Gets the currently loaded assembly in which the specified class is defined. ### Method [Assembly] GetAssembly(Type type) ### Parameters #### Path Parameters - **type** (Type) - A System.Type object representing a class in the assembly that will be returned. ### Returns The assembly in which the specified class is defined. ``` -------------------------------- ### VoidVoidDelegate.__new__ Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.method.test_operators.html Creates a new instance of VoidVoidDelegate. ```APIDOC ## VoidVoidDelegate.__new__ ### Description Creates a new instance of VoidVoidDelegate. ### Method Signature __new__(cls, object object, IntPtr method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) None ``` -------------------------------- ### GetType Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the System.Type object with the specified name in the assembly instance. ```APIDOC ## GetType(name) ### Description Gets the System.Type object with the specified name in the assembly instance. ### Parameters #### Path Parameters - **name** (string) - Required - The full name of the type. ### Returns A System.Type object that represents the specified class, or null if the class is not found. ``` -------------------------------- ### VoidRefInt32Delegate.BeginInvoke Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.event.test_delegate.html Begins an asynchronous invocation of the delegate. ```APIDOC ## BeginInvoke ### Description Begins an asynchronous invocation of the delegate. ### Method (IAsyncResult, int) VoidRefInt32Delegate.BeginInvoke(self, int arg, AsyncCallback callback, object obj) ### Parameters #### Path Parameters - **self** (VoidRefInt32Delegate) - The delegate instance. - **arg** (int) - The integer argument for the delegate. - **callback** (AsyncCallback) - The asynchronous callback. - **obj** (object) - An object containing state information for the asynchronous operation. ``` -------------------------------- ### Load (str, Evidence) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Loads an assembly given its display name, loading the assembly into the domain of the caller using the supplied evidence. ```APIDOC ## Load(assemblyString, assemblySecurity) ### Description Loads an assembly given its display name, loading the assembly into the domain of the caller using the supplied evidence. ### Parameters #### Path Parameters - **assemblyString** (str) - Required - The display name of the assembly. - **assemblySecurity** (Evidence) - Required - Evidence for loading the assembly. ### Returns The loaded assembly. ``` -------------------------------- ### Assembly.GetCustomAttributes (with attributeType) Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the custom attributes for this assembly as specified by type. ```APIDOC ## Assembly.GetCustomAttributes (attributeType) ### Description Gets the custom attributes for this assembly as specified by type. ### Method (Not specified, likely an instance method) ### Parameters #### Path Parameters (None specified) #### Query Parameters (None specified) #### Request Body (None specified) ### Parameters * **attributeType** (Type) - Required - The System.Type for which the custom attributes are to be returned. * **inherit** (bool) - Ignored - This argument is ignored for objects of type System.Reflection.Assembly. ### Returns An array of type Object containing the custom attributes for this assembly as specified by attributeType. ``` -------------------------------- ### Assembly.GetAssembly Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Gets the currently loaded assembly in which the specified class is defined. ```APIDOC ## Assembly.GetAssembly ### Description Gets the currently loaded assembly in which the specified class is defined. ### Method (Not specified, likely a static method) ### Parameters #### Path Parameters (None specified) #### Query Parameters (None specified) #### Request Body (None specified) ### Parameters * **type** (Type) - Required - A System.Type object representing a class in the assembly that will be returned. ### Returns The assembly in which the specified class is defined. ``` -------------------------------- ### Assembly.LoadFrom Source: https://github.com/ironlanguages/ironpython2/blob/master/Tests/plans/interop.net.type.test_assembly.html Loads an assembly from a file, including security evidence, hash value, and hash algorithm. This provides a comprehensive way to load assemblies with specific security constraints. ```APIDOC ## Assembly.LoadFrom(str assemblyFile, Evidence securityEvidence, Array[Byte] hashValue, AssemblyHashAlgorithm hashAlgorithm) ### Description Loads an assembly given its file name or path, security evidence, hash value, and hash algorithm. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **assemblyFile** (str) - Required - The name or path of the assembly file. * **securityEvidence** (Evidence) - Required - Security evidence for loading the assembly. * **hashValue** (Array[Byte]) - Required - The hash value of the assembly. * **hashAlgorithm** (AssemblyHashAlgorithm) - Required - The hash algorithm used for the assembly. ### Returns * **Assembly** - The loaded assembly. ```