[Ironpython-users] IronPython, Daily Digest 12/2/2014

CodePlex no_reply at codeplex.com
Wed Dec 3 09:23:54 CET 2014


Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] no support for parameterized properties with default values

----------------------------------------------

ISSUES

1. [New issue] no support for parameterized properties with default values
http://ironpython.codeplex.com/workitem/35722
User nsstl has proposed the issue:

"The code in the bottom raise the exception [unsupported operand type(s) for -: 'indexer#' and 'int'] if I use the expression with the call for prop1

Option Explicit On
Option Strict On

Imports Microsoft.Scripting.Hosting
Imports IronPython.Hosting
Imports Microsoft.Scripting



Public Class TestObject
    Public ReadOnly Property prop1(Optional param As Double = 10) As Double
        Get
            Return param * 9
        End Get
    End Property
    Public ReadOnly Property prop2 As Double
        Get
            Return 999
        End Get
    End Property
End Class

Module Module1

    Sub Main()
        Dim obj As TestObject = New TestObject
        Dim engine As ScriptEngine = Python.CreateEngine()
        Dim scope As ScriptScope = engine.CreateScope()
        scope.SetVariable("obj", obj)
        Dim expression As CompiledCode = engine.CreateScriptSourceFromString("test = obj.prop1 - 11", SourceCodeKind.Statements).Compile()
        'Dim expression As CompiledCode = engine.CreateScriptSourceFromString("test = obj.prop2 - 11", SourceCodeKind.Statements).Compile()
        expression.Execute(scope)
        Dim ret As Double = CType(scope.GetVariable("test"), Double)
        Console.WriteLine("returned value from python: " & ret)
        Console.ReadLine()
    End Sub

End Module

"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20141203/298676aa/attachment.html>


More information about the Ironpython-users mailing list