This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- PythonContext.Original.cs 2008-10-15 19:13:04.000000000 +0200 | |
+++ PythonContext.cs 2009-01-13 22:45:09.734375000 +0100 | |
@@ -1437,8 +1437,13 @@ | |
} | |
#endif | |
+#if !SILVERLIGHT | |
return baseName + ", Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; | |
#else | |
+ return baseName + ", Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from System import UInt32 | |
class C(object): | |
def __len__(self): | |
return UInt32(3) | |
len(C()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################################################### | |
# | |
# Copyright (c) Microsoft Corporation. All rights reserved. | |
# | |
# This source code is subject to terms and conditions of the Microsoft Public License. A | |
# copy of the license can be found in the License.html file at the root of this distribution. If | |
# you cannot locate the Microsoft Public License, please send an email to | |
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound | |
# by the terms of the Microsoft Public License. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Floatish(float, object): | |
pass | |
import math | |
print math.log10(Floatish(1.5)) | |
print math.log(Floatish(1.5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def FuncA(): | |
raise NotImplementedError() | |
def FuncB(): | |
try: | |
FuncA() | |
finally: | |
pass | |
FuncB() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# throws expected exception | |
# | |
# SyntaxError: 'break' outside loop | |
def e(): | |
break | |
# throws unexpected exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def testcompile(source, flags): | |
err = err1 = err2 = None | |
code = code1 = code2 = None | |
try: | |
code = compile(source, "dummy", "single", flags, 1) | |
except SyntaxError, err: | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
public interface IInterface { | |
} | |
public class Baz : IInterface { | |
} | |
public abstract class Foo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import * | |
import sys | |
MAX_PATH = 260 | |
HICON = c_int | |
class SHFILEINFO(Structure): | |
_fields_ = [("hIcon", HICON), | |
("iIcon", c_int), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
clr.AddReference("Microsoft.Scripting") | |
clr.AddReference("IronPython") | |
from devhawk import consolecolor as cc | |
from IronPython.Hosting.Python import CreateEngine | |
import Microsoft.Scripting.Hosting as msh | |
import Microsoft.Scripting as ms | |
from System import String, Char, Console |