Skip to content

Instantly share code, notes, and snippets.

View ironpythonbot's full-sized avatar

ironpythonbot

View GitHub Profile
@ironpythonbot
ironpythonbot / PythonContext.diff
Created September 28, 2013 01:18
CodePlex Issue #20594 Plain Text Attachments
--- 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";
@ironpythonbot
ironpythonbot / uint32.py
Created September 28, 2013 01:19
CodePlex Issue #20632 Plain Text Attachments
from System import UInt32
class C(object):
def __len__(self):
return UInt32(3)
len(C())
@ironpythonbot
ironpythonbot / pyc.py
Created September 28, 2013 01:20
CodePlex Issue #20863 Plain Text Attachments
#####################################################################################
#
# 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.
#
@ironpythonbot
ironpythonbot / float-log.py
Created September 28, 2013 01:23
CodePlex Issue #21146 Plain Text Attachments
class Floatish(float, object):
pass
import math
print math.log10(Floatish(1.5))
print math.log(Floatish(1.5))
@ironpythonbot
ironpythonbot / ex3.py
Created September 28, 2013 01:28
CodePlex Issue #21422 Plain Text Attachments
def FuncA():
raise NotImplementedError()
def FuncB():
try:
FuncA()
finally:
pass
FuncB()
@ironpythonbot
ironpythonbot / break_exceptions.py
Created September 28, 2013 01:31
CodePlex Issue #21871 Plain Text Attachments
# throws expected exception
#
# SyntaxError: 'break' outside loop
def e():
break
# throws unexpected exception
@ironpythonbot
ironpythonbot / testindentation.py
Created September 28, 2013 01:37
CodePlex Issue #22692 Plain Text Attachments
def testcompile(source, flags):
err = err1 = err2 = None
code = code1 = code2 = None
try:
code = compile(source, "dummy", "single", flags, 1)
except SyntaxError, err:
pass
@ironpythonbot
ironpythonbot / test.cs
Created September 28, 2013 01:38
CodePlex Issue #22827 Plain Text Attachments
using System;
using System.Threading;
public interface IInterface {
}
public class Baz : IInterface {
}
public abstract class Foo {
@ironpythonbot
ironpythonbot / ctypestest.py
Created September 28, 2013 01:38
CodePlex Issue #22829 Plain Text Attachments
from ctypes import *
import sys
MAX_PATH = 260
HICON = c_int
class SHFILEINFO(Structure):
_fields_ = [("hIcon", HICON),
("iIcon", c_int),
@ironpythonbot
ironpythonbot / toktest.py
Created September 28, 2013 01:41
CodePlex Issue #23337 Plain Text Attachments
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