[IronPython] Powershell Sample and IP 2
Michael Foord
fuzzyman at voidspace.org.uk
Wed Apr 23 01:08:02 CEST 2008
Dave Fugate wrote:
> I could be mistaken, but I think it was actually a bug that we did in fact allow calling update on new-style class dictionaries in 1.0:
>
Ah - it is updating on the class rather than the instance - my
mistake... (should be allowed IMHO - but that isn't your fault :-)
Michael Foord
http://www.ironpythoninaction.com/
> IronPython 1.0.60816 on .NET 2.0.50727.1434
> Copyright (c) Microsoft Corporation. All rights reserved.
> >>> class K(object): pass
> ...
> >>> hasattr(K.__dict__, "update")
> True
>
> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> class K(object): pass
> ...
> >>> hasattr(K.__dict__, "update")
> False
>
> IronPython 2.0 Beta (2.0.0.1000) on .NET 2.0.50727.1434
> Copyright (c) Microsoft Corporation. All rights reserved.
> >>> class K(object): pass
> ...
> >>> hasattr(K.__dict__, "update")
> False
>
>
>
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
> Sent: Tuesday, April 22, 2008 1:54 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Powershell Sample and IP 2
>
> Dave Fugate wrote:
>
>> Thanks for reporting this Michael! We actually discovered this internally about a year ago in one of the 2.0 Alphas, and made a few changes to get it (mostly) working again:
>> E:\Merlin\Main\Languages\IronPython\Samples\IPPowerShell>ipyd
>> IronPython 2.0 Beta (2.0.0.1000) on .NET 2.0.50727.1434
>> Copyright (c) Microsoft Corporation. All rights reserved.
>> >>> from powershell import shell
>> >>>
>>
>> At this point I think we'll probably end up re-releasing some of the IP 1.0 samples shortly after IP 2.0 RTM. If you're interested in getting this working under Beta 1 now, the change is fairly simple - replace "ShellOutput.__dict__.update(cmds)" in powershell.py with "ShellOutput.out_string = ShellCommand("Out-String")". Hope that helps.
>>
>>
>>
>
> Well - that isn't an uncommon usage pattern in Python - so the bug that
> prevents you updating into an instance dict should be fixed as well. :-)
>
> Michael
>
>
>> Dave
>>
>>
>> -----Original Message-----
>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
>> Sent: Monday, April 21, 2008 3:21 PM
>> To: Discussion of IronPython
>> Subject: [IronPython] Powershell Sample and IP 2
>>
>> Hello all,
>>
>> Just to let you know that the IronPython Powershell sample is broken for
>> IronPython 2:
>>
>> >>> from powershell import shell
>> Traceback (most recent call last):
>> File , line unknown, in Initialize##224
>> File , line unknown, in _stub_##3
>> File Snippets, line unknown, in Initialize
>> File Snippets, line unknown, in init_runspace
>> AttributeError: 'dictproxy' object has no attribute 'update'
>>
>> :-(
>>
>> Michael
>> http://www.ironpythoninaction.com/
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
More information about the Ironpython-users
mailing list