Re: [IronPython] numpy / IronClad?

2011-03-01 Thread Seo Sanghyeon
2011/3/2 Jeff Hardy jdha...@gmail.com:
 The CPython devs have talked about committing to a stable public ABI
 for 3.3, which would help a lot. I'm not sure if that went any where
 recently, though.

Some of stable ABI work got already in for 3.2.
http://docs.python.org/py3k/whatsnew/3.2.html

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] ElementTree bug?

2010-06-19 Thread Seo Sanghyeon
2010/6/19 David Escobar davidesco...@ieee.org:
 So is this a known bug, or is expat one of the C-based extension modules
 that IronPython doesn't handle yet?

expat is one of C-based extension modules that IronPython doesn't handle yet.

On the other hand, here is my implementation that works with ElementTree:
https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py

Put it on any sys.path directory.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] License change?

2010-04-20 Thread Seo Sanghyeon
2010/4/20 Dino Viehland di...@microsoft.com:
 We’d like to hear your feedback before we make any decisions.  Do you think
 adopting a more popular license, such as the Apache License, would be a good
 change for IronPython?

IANAL, but since MS-PL and Apache License are pretty similar, my main interest
is GPL compatibility. Apache License 2.0 was designed to be compatible with
GPL 3 (but not 2), which is a very good thing. I am unclear about
compatibility of
MS-PL and GPL versions.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Mail archive

2009-12-07 Thread Seo Sanghyeon
Hi, I can't access the mail archive of this list. URL redirects to
Bing's search result page. Is it only me? Any idea?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Django 1.1 on IronPython 2.6rc2 findings

2009-10-29 Thread Seo Sanghyeon
2009/10/30 Vernon Cole vernondc...@gmail.com
 I am cross posting here my inquiry sent to db-sig about how to change 
 paramstyles, along with the only response.

 If you feel that option #1 below is NOT the way to go, please say something 
 now.

 M.-A. Lemburg ✆
 Vernon Cole wrote:
  My question is, what would be an appropriate way to specify the altered
  paramstyle?
 
  1) As an attribute of the connection:
      con = adodbapi.connect('spam eggs)
      con.paramstyle = named

 Most other configuration parameters are made available on
 connections and cursors (with the cursor setting overriding the
 connection one), so I think that's the most DB-API
 compatible way of implementing this.

I agree with this. Sensible.

--
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Django 1.1 on IronPython 2.6rc2 findings

2009-10-28 Thread Seo Sanghyeon
Intro... I, together with Mark Rees, wrote most of adonet-dbapi code in 2006.

2009/10/28 Markus Törnqvist m...@nysv.org:
 Here's the connect function (in its entirety) from mssql.py

 def connect(connstr):
    relevant_parts = [part for part in connstr.split(';') if not 
 part.upper().startswith('PROVIDER')]
    connstr = ';'.join(relevant_parts)
    #return generic_connect(System.Data, 
 System.Data.SqlClient.SqlConnection, connstr)

 Way too hacky for my taste but it gets the job kinda done.

Indeed. The question is, what underlying Python DB-API 2 driver does
django-mssql use? Is it http://pymssql.sourceforge.net/ ?

Argument to connect() function in Python DB-API 2 compliant drivers is
not standardized. In case of pymssql, it receives keyword arguments,
so it should be handled in a manner similar to MySQLdb.py wrapper in
adonet-dbapi. But from your hack it seems django-mssql's underlying
Python DB-API 2 driver expects a string argument, so django-mssql is
building string by itself -- this is ungood. Read psycopg.py wrapper
in adonet-dbapi to see how to handle this.

On the other hand, as I understand, Django does not handle paramstyle
difference in DB-API 2 drivers, so this is kind of a lost cause. How
do other Django DB backends deal with the issue? SQLAlchemy,
fortunately, handles paramstyle difference by itself.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Django 1.1 on IronPython 2.6rc2 findings

2009-10-28 Thread Seo Sanghyeon
2009/10/29 Jeff Hardy jdha...@gmail.com:
 How much overlap is there between your other adodb project and
 adonet-dbapi? I don't think there's any need to have two libraries
 that do the same thing for IronPython, so we might as well figure out
 what's different and work towards one library.

My understanding is that adodb uses COM, so it can't be used with Mono
on Linux. That seals my position against any merge.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Curious about the development cycle and community involvement

2009-10-14 Thread Seo Sanghyeon
2009/10/14  ty...@monkeypox.org:
 One last question, if I were to run a fork of the Subversion tree
 (git-svn(1) woot) which branch should I be using? I see IronPython_Main
 and IronPython_2_6 in trunk/ and I'm not sure which contains active
 development.

IronPython_Main does.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] NTLM authentication

2009-10-06 Thread Seo Sanghyeon
2009/10/6 Aloysius Jegan aloysius.je...@lntemsys.com:
 If any one know how to do NTLM authentication from IronPython, please send
 me the procedure or share the code if you have it.

In IronPython you have a choice of doing it like Python or like .NET.
For Python,
this library provides NTLM authentication for urllib2.

http://code.google.com/p/python-ntlm/

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython Tools and IDEs

2009-09-01 Thread Seo Sanghyeon
2009/9/1 Michael Foord fuzzy...@voidspace.org.uk:
 http://www.voidspace.org.uk/ironpython/tools-and-ides.shtml

This is a great article.

Maybe you should link to IronPython integration feature request on
Microsoft Connect in Visual Studio summary session so that people who
read the article can vote on it?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython ctypes on Linux

2009-08-03 Thread Seo Sanghyeon
2009/8/4 Slide slide.o@gmail.com:
 I'm not sure if there is standard library that this is implemented on
 all *NIX platforms. It is possibly different.

No. dlopen and friends are POSIX standard.
http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.html

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython ctypes on Linux

2009-08-03 Thread Seo Sanghyeon
2009/8/4 Dino Viehland di...@microsoft.com:
 Any thoughts on this?  I can trivial add a DllImport to dlopen but
 I need to know where it's declared :)

I believe libc is the right one. From what I can tell, Mono maps
DllImport(libc) to whatever real C library file for the target
platform (this filename differs between Linux and Mac, etc).

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython ctypes on Linux

2009-08-03 Thread Seo Sanghyeon
2009/8/4 Seo Sanghyeon sanx...@gmail.com:
 2009/8/4 Dino Viehland di...@microsoft.com:
 Any thoughts on this?  I can trivial add a DllImport to dlopen but
 I need to know where it's declared :)

 I believe libc is the right one. From what I can tell, Mono maps
 DllImport(libc) to whatever real C library file for the target
 platform (this filename differs between Linux and Mac, etc).

Oops, no. Although libc is mapped as I said, dlopen and friends are
not in the C library, it seems. :(

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] SQLite

2009-07-29 Thread Seo Sanghyeon
2009/7/30 Kelie kf9...@gmail.com:
 Is SQLite currently supported in IronPython? If not, is SQLite .NET
 from http://sqlite.phxsoftware.com/ the best alternative?

Seems so. Others have replied about this.

One alternative was not mentioned in this thread. That is, CPython's
SQLite module('s upstream), pysqlite, has been ported to ctypes
FFI in the past. Now IronPython has ctypes, in theory, this pure Python
version should work without modification.

I don't think it will work without modification :) but it certainly would
be a great stress test for IronPython's new ctypes implementation.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] IronPython ctypes on Linux

2009-07-25 Thread Seo Sanghyeon
Hopefully I'm not too late on reporthing this...

If you look at ctypes/__init__.py in Python 2.6, it imports different
functions from _ctypes depending on os.name. So on Linux, it expects
dlopen to be available, instead of LoadLibrary.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] FePy status update

2009-07-15 Thread Seo Sanghyeon
Now I updated FePy's NAnt build file to include newly introduced
Microsoft.System.Debugging.dll.

I also found that I need to define CLR2 symbol to compile
Microsoft.Dynamic.dll. Without the symbol it won't compile. What is
the purpose of this symbol?

Sorry for the delay,

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bazaar on IronPython

2009-07-01 Thread Seo Sanghyeon
2009/6/30 Martin (gzlist) gzl...@googlemail.com:
 For anyone who is interested, I have done a little work getting the
 DVCS bazaar working on IronPython 2.0 and 2.6 - please see this
 message and attached patch:
 https://lists.canonical.com/archives/bazaar/2009q2/060028.html

You seem to use xmllib to get ElementTree working. If you need
pyexpat for IronPython, you can use my implementation:

http://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py

Just drop it in sys.path.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Random Number Generation

2009-06-24 Thread Seo Sanghyeon
2009/6/25 Adam Brand ad...@silverkeytech.com:
 I tried “import random” but that doesn’t seem to work (module not found).

Works for me. Do you have Python standard library in sys.path?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Twisted on IronPython

2009-06-19 Thread Seo Sanghyeon
I have started porting Twisted to IronPython.

Progress is to be tracked on this Trac ticket:
http://twistedmatrix.com/trac/ticket/3882

Buildbot is up:
http://buildbot.twistedmatrix.com/builders/ubuntu32-ironpython

Just in case you don't know, Twisted is an event-driven networking
engine written in Python licensed under MIT license, which aims to
destroy the American currency system. See following links for more
details.

http://twistedmatrix.com/
http://isometric.sixsided.org/_/twisted_plutonium/

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython 2.6 CodePlex Source Update

2009-06-19 Thread Seo Sanghyeon
2009/6/20  merl...@microsoft.com:
 Once this is in I’ll be updating Igor’s prototype for sys.settrace support 
 for IronPython and adding that.

This is exciting.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] os.strerror

2009-06-17 Thread Seo Sanghyeon
os.strerror is not implemented. Something as simple as the following woud work:

import os
import errno

def strerror(code):
if code == errno.ENOENT:
return 'No such file or directory'
elif code == errno.EACCES:
return 'Permission denied'
else:
return 'Unknown error ' + str(code)
os.strerror = strerror

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] __module__ of FunctionType

2009-06-17 Thread Seo Sanghyeon
Following program prints different result between CPython and IronPython:

def f(): pass
print type(f).__module__

CPython: __builtin__
IronPython: property# __module__ on function

This breaks codes which assume __module__ is a string.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] os.access bug

2009-06-16 Thread Seo Sanghyeon
os.access('/nonexistent', os.X_OK) raises. It should return False.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Exception for setting attributes of built-in type

2009-06-14 Thread Seo Sanghyeon
Exception for setting attributes of built-in type differs between
CPython and IronPython. This is not purely theoretical, as
zope.interface tries to set Implements declaration as __implemented__
attribute of built-in type object, and excepts TypeError.

Python 2.6.1
 object.flag = True
TypeError: can't set attributes of built-in/extension type 'object'

IronPython 2.6
 object.flag = True
AttributeError: 'object' object has no attribute 'flag'

I was surprised that CPython raises TypeError. Library Reference seems
to mention it here:

exception AttributeError
Raised when an attribute reference or assignment fails. (When an
object does not support attribute references or attribute assignments
at all, TypeError is raised.)
http://docs.python.org/library/exceptions.html

What does it mean that an object does not support attribute
references or attribute assignments at all?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Fwd: [Mono-dev] Current 'xbuild' status

2009-06-09 Thread Seo Sanghyeon
FYI.

From: Ankit Jain radi...@gmail.com
Date: 2009/6/10
Subject: [Mono-dev] Current 'xbuild' status

Current xbuild status:

It can handle solutions (.sln) now, thanks to Jonathan Chambers,
with C#, VB.net projects. Handles embedded resources, satellite
assemblies, project references etc.

Eg. Paint.Net 3 ( builds completely with it now, IronPython (2.0.1)
builds, IronPython svn (builds with compile time errors) etc.

Only .net 2.0 projects are supported currently though. I will start
adding support for newer versions very soon, also ASP.NET, Silverlight
etc projects.

This is part of the mono 2.4.2 release
(http://mono.ximian.com/monobuild/preview/download-preview/)
and is a *big* improvement over xbuild in the last release.
Would be really helpful to get feedback and bug reports on this :)
You can file bugs at : http://www.mono-project.com/Bugs

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] __objclass__

2009-06-09 Thread Seo Sanghyeon
2009/6/10 Michael Foord fuzzy...@voidspace.org.uk:
 All .NET classes used from IronPython have an __objclass__ attribute on
 their methods / members. This is *really* useful for introspection - can I
 rely on it staying or is it an implementation detail that may change?

Since this is also a CPython behavior (although undocumented, or poorly
documented one), it's unlikely to change. __objclass__ of a descriptor
points to its class.

C:\python
Python 2.6.1
 object.__repr__.__objclass__
type 'object'

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] 2.6 Beta 1 Bug: help() requires _getframe support which is now optional

2009-05-24 Thread Seo Sanghyeon
2009/5/24 Mike Krell mbk.li...@gmail.com:
 With 2.6 beta 1 and without -X:frames:
 help()
 Traceback (most recent call last):
 File stdin, line 1, in module
 File C:\Program Files\IronPython 2.6\Lib\site.py, line 428, in __call__
 File C:\Program Files\IronPython 2.6\Lib\pydoc.py, line 53, in
 C:\Program Files\IronPython 2.6\Lib\pydoc.py
 File C:\Program Files\IronPython 2.6\Lib\inspect.py, line 950, in
 C:\Program Files\IronPython 2.6\Lib\inspect.py
 AttributeError: 'module' object has no attribute '_getframe'

Temporary workaround: run reload(__builtins__) at the beginning of
interactive sessions.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] unsupported operand type(s) for operator overloading.

2009-05-12 Thread Seo Sanghyeon
2009/5/13 李兵 dreamwinte...@gmail.com:
 IronPython expression like this ' A.Create(Audit) ==  A.Create(Test1) 
 A.CreateProperty(Sum) == A.Create(Test2) '

This is a rare pitfall. In C (and C#), == has higher precedence than
, but in Python,  has higher precedence than ==. So IronPython is
complaining that it can't process A.Create(Test1) 
A.CreateProperty(Sum).

Probably you meant (A.Create(Audit) == A.Create(Test1)) 
(A.CreateProperty(Sum) == A.Create(Test2))?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] adodbapi with ado.net? (on MONO?)

2009-05-11 Thread Seo Sanghyeon
2009/5/12 Vernon Cole vernondc...@gmail.com:
 Question for the group:
  If I were to fork a version of adodbapi which used ado.net (rather
 than COM ado) ...
  1) would it work any better/faster than the existing code on Windows?
  2) is there any chance that it would run under MONO on Linux?

1. No idea.
2. Yes.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] FePy status update

2009-05-09 Thread Seo Sanghyeon
FePy seems to be dead, right? Sorry about that. This is a brief status
update. And I could use it later as a changelog. How convinient.

1. I am now testing IronPython with CPython 2.6 standard library. FePy
used 2.4 so far. Be sure to check collections.py issue Dave mentions
here:
http://knowbody.livejournal.com/13271.html

2. NAnt build system has been updated to the latest source layout
change. My goal still is to do away with NAnt and improve Mono's
implementation of MSBuild to build IronPython out of the box, but that
hasn't progressed a bit, sorry. Dave wrote about the source layout
change here:
http://knowbody.livejournal.com/13980.html

3. ExtensionAttribute problem mentioned in the last December is gone.
Mono bug on reference equality with generic constraints mentioned in
March is still there. FePy trunk patches/latest has a workaround for
this. Net result is that latest IronPython source drops from CodePlex
compiles and runs with Mono! And no compiler warnings! (This has been
my pet peeve, you know.) And I had no problem keeping it that way for
some time. I updated IronPython on Mono reports page with relevant
mails.
http://fepy.sourceforge.net/doc/ironpython-mono-report.html

4. There is an IronPython bug that manifests only on Mono due to
newline difference. The symptom is that expressions are not printed in
interactive console. This took some time to debug, but there is a fix
now.
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-April/010140.html

5. Current build on my local system generally works. It imports urllib
and urllib2. This is quite a stress test... Not just import, but
downloading webpages work too. On the other hand, importing decimal
crashes Mono in segmentation fault! I suspect this has to do with move
to 2.6 standard library and its abstract base classes meta
machineries, but who knows.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] FePy status update

2009-05-09 Thread Seo Sanghyeon
2009/5/9 Jb Evain j...@nurv.fr:
 Hey Seo,

 On 5/9/09, Seo Sanghyeon sanx...@gmail.com wrote:
  4. There is an IronPython bug that manifests only on Mono due to
  newline difference. The symptom is that expressions are not printed in
  interactive console. This took some time to debug, but there is a fix
  now.
  http://lists.ironpython.com/pipermail/users-ironpython.com/2009-April/010140.html

 Fwiw, I reported it on ironruby-core weeks ago:

 http://rubyforge.org/pipermail/ironruby-core/2009-March/004008.html

 Along with a patch.

Oops, how did I miss that. Apparently this was to be fixed
see http://rubyforge.org/pipermail/ironruby-core/2009-March/004089.html
but somehow slipped for 2 months...

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] FePy status update

2009-05-09 Thread Seo Sanghyeon
2009/5/9 Seo Sanghyeon sanx...@gmail.com:
 2009/5/9 Jb Evain j...@nurv.fr:
 Hey Seo,

 On 5/9/09, Seo Sanghyeon sanx...@gmail.com wrote:
  4. There is an IronPython bug that manifests only on Mono due to
  newline difference. The symptom is that expressions are not printed in
  interactive console. This took some time to debug, but there is a fix
  now.
  http://lists.ironpython.com/pipermail/users-ironpython.com/2009-April/010140.html

 Fwiw, I reported it on ironruby-core weeks ago:

 http://rubyforge.org/pipermail/ironruby-core/2009-March/004008.html

 Along with a patch.

 Oops, how did I miss that. Apparently this was to be fixed
 see http://rubyforge.org/pipermail/ironruby-core/2009-March/004089.html
 but somehow slipped for 2 months...

I filed an issue against DLR, please vote:
http://dlr.codeplex.com/WorkItem/View.aspx?WorkItemId=3010

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Running Scripts/generate.py on CPython

2009-04-29 Thread Seo Sanghyeon
Scripts/generate.py has a comment: TODO: does it make sense to run
this under CPython?. I think so. The following is how I did that:

1. Delete import nt at the top. It is imported later anyway.
2. Change root_dir and source_directories. (Because source layout is
different, but change is easy.)
3. Uncomment lines under TODO: does it make sense...
4. Define basename as os.path.basename and System.IO.Path.GetFileName
just like isdir. Use it later.

Maybe change 1 and 4 can be made on IronPython?

Also change code_text += \n to \r\n if you want to avoid line
ending difference.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Expression printing in interactive mode

2009-04-29 Thread Seo Sanghyeon
In changeset 42603, a change was made to
IronPython.Hosting.PythonCommandLine.RunOneInteraction,

- SourceUnit su = Language.CreateSnippet(s, stdin,
SourceCodeKind.InteractiveCode);
+ SourceUnit su = Language.CreateSnippet(s, stdin,
(s.Contains(Environment.NewLine))? SourceCodeKind.Statements :
SourceCodeKind.InteractiveCode);

Why is this? It seems to me that s always contains newline, so its net
effect is making all interactive code non-interactive. In Python, this
means no expression is printed in interactive mode.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Expression printing in interactive mode

2009-04-29 Thread Seo Sanghyeon
2009/4/30 Dino Viehland di...@microsoft.com:
 Looking at the code thought I'm guessing this is totally broken on
 Unix because in ReadStatement we append a newline, with a
 wonderful comment there:

                // Note that this does not use Environment.NewLine because 
 some languages (eg. Python) only
                // recognize \n as a line terminator.
                b.Append(\n);

 So this just happens to do the right thing on Windows due to the
 mismatches between the new lines being used.

Ah, mystery solved. So it worked by accident on systems where NewLine != \n...

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] pywin32 on Iron Python?

2009-04-29 Thread Seo Sanghyeon
2009/4/30 Michael Foord fuzzy...@voidspace.org.uk:
 I can't believe that editing / redacting commit messages is an impossible
 challenge. :-)

No, but *automating* editing/redacting commit message will be well nigh
impossible challenge. :(

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiling IP2 on mono

2009-01-18 Thread Seo Sanghyeon
2009/1/18 Sylvain Hellegouarch s...@defuze.org:
 Hi folks,

 I've tried following Seo's steps [1] for compiling IP2 on the current mono
 trunk but it keeps failing with the next error:

 sylv...@localhost:~/download/IronPython-2.0/Src$ nant
 NAnt 0.86 (Build 0.86.2898.0; beta1; 08/12/2007)
 Copyright (C) 2001-2007 Gerry Shaw
 http://nant.sourceforge.net

 Buildfile: file:///home/sylvain/download/IronPython-2.0/Src/IronPython.build
 Target framework: Mono 2.0 Profile

 [csc] Compiling 200 files to
 '/home/sylvain/download/IronPython-2.0/Src/Microsoft.Scripting.Core.dll'.
 [csc]
 /home/sylvain/download/IronPython-2.0/Src/Microsoft.Scripting.Core/Actions/MetaObjectExtensions.cs(20,27):
 error CS0234: The type or namespace name `Generation' does not exist in the
 namespace `Microsoft.Scripting'. Are you missing an assembly reference?
 [csc]
 /home/sylvain/download/IronPython-2.0/Src/Microsoft.Scripting.Core/Actions/MetaObjectExtensions.cs(20,27):
 error CS0234: The type or namespace name `Generation' does not exist in the
 namespace `Microsoft.Scripting'. Are you missing an assembly reference?
 [csc] Compilation failed: 2 error(s), 0 warnings

Did you apply patch-exthack? That should get rid of this namespace import.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Frames in IronPython

2008-12-31 Thread Seo Sanghyeon
2008/12/31 Jeff Hardy jdha...@gmail.com:
 I don't know what the feature list is going to be for 2.1, but I'd
 like to see frame objects near the top. Almost every piece of Python
 code I've tried uses them in some way. Often it's for debugging
 purposes (and can be worked around), but not always. Trac has this
 lovely piece of code:

This is pretty sad state of affair, especially considering that such
(like Trac's) use of getting frame local is usually unnecessary with
a bit of metaclass.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Invalid construct in DLR's MSBuild file?

2008-12-17 Thread Seo Sanghyeon
2008/12/16 Curt Hagenlocher c...@hagenlocher.org:
 This looks like a problem in quite a few of our csproj files.  Could you
 open up a bug report on CodePlex for this?

Done.
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=20262

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Determine the classes/interfaces a Python implements

2008-12-15 Thread Seo Sanghyeon
2008/12/16 Michael Foord fuzzy...@voidspace.org.uk:
 Probably the easiest way of doing this is to define a Python function that
 uses issubtype. You can use this as a delegate from the C# side (warning
 untested):

You mean issubclass...

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Invalid construct in DLR's MSBuild file?

2008-12-10 Thread Seo Sanghyeon
Hello, now I am trying to use xbuild (open source implementation of
MSBuild language) to build IronPython, and the first error (after
instrumenting the source to make it clear what the error is) is this:

$ xbuild Microsoft.Scripting.ExtensionAttribute.csproj
XBuild Engine Version 0.1
Mono, Version 2.3.0.0
Copyright (C) Marek Sieradzki 2005. All rights reserved.
ConditionParser failed to parse  $(SilverlightBuild) != 'true'

Unhandled Exception:
Microsoft.Build.BuildEngine.InvalidProjectFileException: The requested
feature is not implemented. --- System.NotImplementedException: The
requested feature is not implemented.
  at Microsoft.Build.BuildEngine.ConditionParser.ParseFactorExpression
() [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseRelationalExpression
() [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseBooleanOr () [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseBooleanAnd () [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseBooleanExpression
() [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseExpression () [0x0]
  at Microsoft.Build.BuildEngine.ConditionParser.ParseCondition
(System.String condition) [0x0]
  --- End of inner exception stack trace ---
  at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader
textReader) [0x0]
  at Microsoft.Build.BuildEngine.Project.Load (System.String
projectFileName) [0x0]
  at Mono.XBuild.CommandLine.MainClass.Execute () [0x0]

According to MSDN, MSBuild Conditions
http://msdn.microsoft.com/en-us/library/7szfhaft.aspx conditions
should be of the form 'stringA' != 'stringB', where single quotes are
not required for simple alphanumeric strings or boolean values. Is
$(SilverlightBuild) this case? If it isn't, shouldn't it be quoted as
'$(SilverlightBuild)'?

If I manually change this condition to be quoted (I also note, all
other uses of $(SilverlightBuild) is actually quoted in this file),
xbuild builds this assembly successfully.

Even if this is actually valid (then I argue documentation is
confusing), I think it would be a good idea to quote this anyway.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] IronPython 2.0 RC 2 on Mono

2008-12-07 Thread Seo Sanghyeon
Currently you need Mono SVN (both to run and to compile). Using SVN
r120972 below.

The binary runs fine.

IronPython includes its own copy of ExtensionAttribute, but this
doesn't seem to work with Mono C# compiler: that is, extension methods
don't get recognized as extension methods. This causes trouble where
MetaObject is defined in Microsoft.Scripting.Core.dll, and its
extensions are defined in MetaObjectExtensions in
Microsoft.Scripting.dll. My hack below copies MetaObjectExtensions and
its dependencies to Microsoft.Scripting.Core and patch it to be a
partial class instead of a static class housing extension methods. Any
better idea?

Also there are some unused files in the source distribution.

Below are steps I used to compile the source on Mono.

Download source from
http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=19841
$ unzip IronPython-2.0-Src.zip
$ cd IronPython-2.0

Some hacks...
$ svn co -r 597
https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/latest
build

This deletes unused files and does copying mentioned above
$ sh build/pre.sh

Copies NAnt build file: it uses noconfig to avoid pulling System.Core.dll
$ cp build/IronPython.build Src

Patches
$ patch -p1  build/patch-exthack
$ patch -p1  build/patch-console

Build
$ cd Src
$ nant

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Logging module error

2008-12-02 Thread Seo Sanghyeon
2008/12/2 Deepali Abhyankar [EMAIL PROTECTED]:
 (logging and _getframe)
 Please suggest solution to resolve this

https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/stdlib/2.4.4/patch-stdlib-logging-getframe

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Codeplex Issue:

2008-11-12 Thread Seo Sanghyeon
2008/11/12 Michael Foord [EMAIL PROTECTED]:
 In general it is great - IronPython samples *should* follow PEP 8 as much as
 possible (how come Ruby guys got nice method aliasing and we didn't by the
 way? Hmm... maybe excessive aliasing isn't Pythonic).

I agree. IronRuby's rubification of method name is on too magic side for me,
and hopefully not Pythonic. :)

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Python Standard Library in IronPython

2008-10-30 Thread Seo Sanghyeon
2008/10/31 Michael Foord [EMAIL PROTECTED]:
 Kenneth Miller wrote:
 http://www.bitbucket.org/xkenneth/atheneum/src/tip/atheneum/
 Where are the tests?

Apparently here:
http://www.bitbucket.org/xkenneth/atheneum/src/

A sibling directory, not a child directory.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] An issue with using System.Xml as a Python DOM implementation

2008-10-30 Thread Seo Sanghyeon
I am not sure to whom this mail should be addressed. Please help if you know.

I am considering the idea of using System.Xml as a Python DOM
implementation again. After some experimentation, one issue is this:
an idiomatic way to check for the type of DOM node in Python is:

if node.nodeType == node.ELEMENT_NODE:

nodeType is spelled NodeType with capital N in .NET, but that's fine.
I can translate naming convention. The problem is that .NET's XmlNode
type does not have attributes for DOM node types, that is,
ELEMENT_NODE, ATTRIBUTE_NODE, etc. Instead, these attributes ara
available under XmlNodeType enumeration, with wholly different names,
like Element, Attribute, etc.

My question is, why is this blatant incompatibility?

DOM level 1 Core standard
http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html

seems to clearly say that Node interface should have constants like
ELEMENT_NODE, ATTRIBUTE_NODE, etc. defined.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Python Standard Library in IronPython

2008-10-29 Thread Seo Sanghyeon
2008/10/29 Kenneth Miller [EMAIL PROTECTED]:
 http://github.com/xkenneth/gxml/tree/master

What do you think about http://trac.defuze.org/wiki/bridge ?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Python Standard Library in IronPython

2008-10-29 Thread Seo Sanghyeon
2008/10/29 Kenneth Miller [EMAIL PROTECTED]:
 How would these modules be structured, I'd simply just recreate what we need
 out of the standard library using .NETs classes. So for instance for os.path
 i'd literally write a new module. I've got the pure python implementation of
 elementtree along PDIS-XPATH for xpath operations. I've written a few
 modules here:
 http://github.com/xkenneth/gpath/tree/master
 http://github.com/xkenneth/gxml/tree/master

Okay, here is my take on how clipath would be structured:
http://www.bitbucket.org/sanxiyn/clipath/

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Python Standard Library in IronPython

2008-10-29 Thread Seo Sanghyeon
2008/10/30 Kenneth Miller [EMAIL PROTECTED]:
 Seo,
Can you give me access to this code? I signed up on bitbucket as
 xkenneth.

Done.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Python Standard Library in IronPython

2008-10-28 Thread Seo Sanghyeon
2008/10/29 Kenneth Miller [EMAIL PROTECTED]:
   I know I can access just about everything in the python standard library
 by simply adding it to the ironpython path, however this is not a good
 solution when writing dynamic applications in Silverlight. I can include the
 standard library with my silverlight application, but this bloats the
 package and causes horrible load times. I started writing some abstractions
 last night to do common path operations using whatever library is present
 (.Net vs cpy) when it dawned on me to simply re-map common functions in the
 python standard library to the .Net equivalent. Has something like this
 already been done? If not, does anyone have any interest in doing this?

This is a good idea, and I actually planned to do this for path manipulation
some time ago, named clipath (analogy to ntpath, posixpath, etc.).
Another obvious candidate is clidom, reusing .NET's DOM classes.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] XML Support in IronPython

2008-10-21 Thread Seo Sanghyeon
2008/10/21 Michael Foord [EMAIL PROTECTED]:
 Are you using FePy? The minidom support Seo was talking about is only in
 FePy and not the standard IronPython distribution.

Doesn't the standard IronPython distribution now include CPython
standard library
from 2.5, including xml.dom.minidom?

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] XML Support in IronPython

2008-10-20 Thread Seo Sanghyeon
2008/10/21 Kenneth Miller [EMAIL PROTECTED]:
 Do I simply need to import the module? I'm using the distribution of
 IronPython distributed with the Silverlight Dynamic Languages SDK. My code
 still chokes on from xml.dom.minidom import parse

You need to make it importable. You don't actually need to import it, although
it shouldn't hurt.

Do you have the error message? It works for me.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] XML Support in IronPython

2008-10-19 Thread Seo Sanghyeon
2008/10/20 Kenneth Miller [EMAIL PROTECTED]:
I've just built my project on top of minidom, for which there is no
 support in IronPython, so I'm wondering if there are any compatibility
 abstractions and/or what are my options for XML processing under ironpython?

Yes there is. Grab pyexpat.py from FePy project and put it on somewhere you can
import. Then CPython's minidom will just work.

https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] CodePlex SVN is a crap

2008-10-18 Thread Seo Sanghyeon
I tried for some time to use https://ironpython.svn.codeplex.com/svn
instead of CodePlex Source Code tab .zip download, but it's unusable.
I routinely get:

svn: Server sent unexpected return value (500 Internal Server Error)
in response to REPORT request for '/svn/!svn/vcc/default'

or some such stuffs. Can someone pester the right people to get this
to work correctly?

svn, version 1.5.1 (r32289)

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Warning CS3006

2008-10-10 Thread Seo Sanghyeon
2008/10/11 Dino Viehland [EMAIL PROTECTED]:
 It sure looks like it - are there more though?  I'd expect one for each 
 action kind.  The methods differ in generic arity and the type of array they 
 accept so at the very least the error string is wrong even if it is bad style 
 to differ that way.

I think mcs is warning that you have params there. GetMemberAction
and ComboBinder are only ones with the signature:
public override MetaObject Bind(params MetaObject[] args)
and not:
public override MetaObject Bind(MetaObject[] args)

Other actions don't have params attribute and mcs doesn't warn about them.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Warning CS3006

2008-10-08 Thread Seo Sanghyeon
Can you confirm that following two warnings are likely to be a Mono
compiler bug?

/home/tinuviel/svn/ironpython/Src/Microsoft.Scripting.Core/Actions/GetMemberAction.cs(44,43):
warning CS3006: Overloaded method
`Microsoft.Scripting.Actions.GetMemberAction.Bind(params
Microsoft.Scripting.Actions.MetaObject[])' differing only in ref or
out, or in array rank, is not CLS-compliant
/home/tinuviel/svn/ironpython/Src/Microsoft.Scripting/Actions/ComboBinder.cs(42,36):
warning CS3006: Overloaded method
`Microsoft.Scripting.Actions.ComboBinder.Bind(params
Microsoft.Scripting.Actions.MetaObject[])' differing only in ref or
out, or in array rank, is not CLS-compliant
/home/tinuviel/svn/ironpython/Src/Microsoft.Scripting.Core/Actions/MetaAction.cs(159,36):
(Location of the symbol related to previous warning)

Otherwise, I am very happy to report that entire IronPython codebase
is warning-free on Mono now!

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Yield Prolog Benchmarks

2008-10-07 Thread Seo Sanghyeon
2008/10/7 Dino Viehland [EMAIL PROTECTED]:
 I took a look and we're spending most of our time doing old instance/old 
 class accesses.  If they used new-style classes it would probably run faster 
 - although CPython might as well :)  It seems like a good chunk of that is 
 coming from __eq__/__cmp__ on the old-style classes - and w/ new-style 
 classes we can make that really fast.

Thank you for this insight. Here are numbers with new-style classes.
(Just edit Variable.py to let IUnifiable inherit from object.)

Python 27.3299986451 27.3397389892 27.3310241944
IronPython 33.4816662453 33.4575162486 33.4634488462

So... yes, with new-style classes IronPython gets faster than CPython
with old-style classes, but CPython runs faster with new-style classes
as well. Just as you predicted. :)

Since this is clearly beneficial, I mailed the author a patch to make
old-style-new-style change.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Yield Prolog Benchmarks

2008-10-07 Thread Seo Sanghyeon
2008/10/8 Seo Sanghyeon [EMAIL PROTECTED]:
 Since this is clearly beneficial, I mailed the author a patch to make
 old-style-new-style change.

It has been applied.
http://yieldprolog.svn.sourceforge.net/viewvc/yieldprolog?view=revrevision=887

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Yield Prolog Benchmarks

2008-10-05 Thread Seo Sanghyeon
Yield Prolog is an embeddable Prolog implementation that compiles to
Python, C#, or JavaScript using yield statements in those languages.
http://yieldprolog.sourceforge.net/

It comes with a nice benchmark calculating 2680 solutions of 11-queens
problem in Prolog. So I tried it out of curiosity.
http://yieldprolog.sourceforge.net/benchmarks.html

How to run:
svn co https://yieldprolog.svn.sourceforge.net/svnroot/yieldprolog/YieldProlog
yieldprolog
cd yieldprolog/source/python
# Edit Compiler.py to comment out from compiler import *. It is not needed.
cd examples/Benchmarks
python queens.py

Intel Core 2 T7200 2.00GHz 2.00GB RAM
Microsoft Windows XP Home Edition SP2

Python 2.5.1
36.2195480152 36.3135356589 36.0008464763

IronPython 2.0 Beta 5 on .NET Framework 3.5 SP1
52.5789892291 53.0868051666 53.0352047537

In this particular benchmark, IronPython 2 comes about 30% slower than
Python 2.5. Mono is much, much slower than .NET for this particular
benchmark, by the way. I am investigating.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] SVN access to IronPython source...

2008-09-16 Thread Seo Sanghyeon
2008/9/17 Dino Viehland [EMAIL PROTECTED]:
 Which of course includes IronPython.  So if you don't have TFS, or you're
 running on some OS where it's not available, or just love SVN you can access
 the IronPython repository at https://IronPython.svn.codeplex.com/svn

This is totally cool.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] __displayhook__

2008-08-31 Thread Seo Sanghyeon
2008/8/31 Michael Foord [EMAIL PROTECTED]:
 There is another weirder issue that William has discovered. Ironclad works
 by installing an import hook. In the process of this, the following things
 happen:

 * sys.executable gets set to None
 * sys.argv[0] gets set to None
 * Our patched sys.__displayhook__ disappears

 Unfortunately a 'minimal repro' of this is not easy - so I'm reporting it
 here in the meantime.

This sounds like that sys module is being reloaded.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Ironclad v0.5 released

2008-08-21 Thread Seo Sanghyeon
2008/8/21 Michael Foord [EMAIL PROTECTED]:
 It may be still too early - but a useful test for Ironclad might be to get
 matplotlib to import and generate a simple chart.

 That would require being able to import numpy *and* PIL (so would exercise
 Ironclad fairly thoroughly) and allow you to do something practical with it.

Not to speak of huge amount of pure Python codes in matplotlib, which
I assume is bound to trigger some IronPython compat bug... (It's just a lot of
codes. No offense intended to IronPython team.)

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] importing on different threads

2008-08-21 Thread Seo Sanghyeon
2008/8/21 Curt Hagenlocher [EMAIL PROTECTED]:
 Where IronPython is worse than CPython in this regard is that it takes us
 longer to import a module.  This increases the chance for a collision in an
 application where modules may be imported from multiple threads.

No, IronPython is worse in that its importer is not locked. CPython has
(in addition to Global Interpreter Lock, since imported module can be
a C extension)
a lock around its importer: see imp.acquire_lock and imp.release_lock. Since
import can cause another import, this is a reentrant lock.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] How do I determine whether a database supports transactions?

2008-08-20 Thread Seo Sanghyeon
2008/8/21 Curt Hagenlocher [EMAIL PROTECTED]:
 In the long term, I think you're definitely better off rewriting against
 ADO.NET, but I can certainly see the attraction in getting something to work
 more quickly if you can continue to use the COM ADO objects.

Especially, when it seems to me that interface provided by
CPython/win32com is almost compatible with IronPython/.NET COM
interop.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Informal Poll: measuring IronPython performance under x64 OSes

2008-08-18 Thread Seo Sanghyeon
2008/8/19 Dan Eloff [EMAIL PROTECTED]:
 I run IronPython on x64 Vista, but mostly only in Silverlight, which
 correct me if I'm wrong, is 32bit only. So right now, I don't care
 about x64 Vista. But when Silverlight runs in x64 it will matter to
 me. There will probably be more x64 vista desktop users out there than
 Mac and Linux combined by that time. I don't use IronPython in a
 server context, I prefer to run linux servers with CPython, and
 IronPython on Mono doesn't quite make the grade in my opinion (largely
 the fault of Mono). But if I did, it would be x64, because I only use
 x64 servers.

Well said, but in that case (IronPython on x64 servers, and I assume which
runs Linux), what you want is benchmark of Mono amd64 JIT, not Vista x64.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Performance of IronPython 2 Beta 4 and IronPython 1

2008-08-14 Thread Seo Sanghyeon
2008/8/15 Dino Viehland [EMAIL PROTECTED]:
 BTW time.clock() is what I usually use to measure which works on both CPython 
 and IronPython.  On Ipy we use the .NET Stopwatch class which uses a high 
 resolution counter if it's available.

This is what you should do. Python Library Reference says:

http://docs.python.org/lib/module-time.html#l2h-2819
clock() ... in any case, this is the function to use for benchmarking
Python or timing algorithms.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Horrible performance regression of exec on IP2

2008-08-11 Thread Seo Sanghyeon
This is just to let you know that I filed a CodePlex issue on this
topic. Please comment (and vote!) there.
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=17781

In particular, I am interested in the result of execfib.py on .NET.
Current data is on Mono.

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Horrible performance regression of exec on IP2

2008-08-11 Thread Seo Sanghyeon
2008/8/12 Dino Viehland [EMAIL PROTECTED]:
 This is probably because we'll interpret code that is executed using exec.  
 So anything very computationally heavy will be slow in exec.  Maybe we need a 
 way to disable that.

Argh, I was using exec as a poor man's macro tool. Exactly
computationally heavy code was roop-unrolled using exec.

You can guess why I was very disappointed...

-- 
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] My takes on C Extensions for IronPython

2007-10-17 Thread Seo Sanghyeon
The discussion is getting very confusing, so here are some of my takes
on the issues.

On the issue of P/Invoke declarations for Python/C API, Paolo Molaro
wrote:

The python API requires a couple dozen structure definitions plus a
few dozen dllimport declarations. This can be about 200 lines of
trivial to write declarative stuff.

It's certainly more than 200 lines, and it's not completely trivial
because some parts of Python/C API are C macros, not C functions.
(Reference counting is the most important, but also getting
type(=vtable) of Python objects and like.)

The good news is that this part is already developed, debugged, and
pretty much finished -- for Python 2.3 to 2.6, and for wide and narrow
unicode builds of Python. Get it here (~ 1600 lines):
http://pythonnet.svn.sourceforge.net/svnroot/pythonnet/trunk/pythonnet/src/runtime/runtime.cs

Assuming that ZPL (which is OSI-certified) is okay, it would be
strange not to use this.

On the issue of compiling C or C++ to CLI, Keith J. Famer wrote:

My impression was that they're working under the assumption that you
cannot get C++ code to compile to pure managed (False, use C++/CLI as
recommended on the Mono site), and that it must *compile* under Mono
(laudable, but I doubt it's necessary -- I've never bothered to
recompile the Python Libraries).

Readers not familiar with the issue should read Mono documentation
mentioned:
http://www.mono-project.com/CPlusPlus

I understand MC++ or Managed C++ is used to refer related
technologies, but in the narrow sense it is a compiler that shipped
with .NET 1.x which produced mix of managed and x86 code. I
believe .NET 2.x compiler, i.e. C++/CLI is what is currently
discussed.

It would be nice to be able to compile without Microsoft tools, but I
don't think it's essential. If assembly compiled with C++/CLI /
clr:pure can be made to run on Mono that's fine.

Also Mono page doesn't mention this, but GCC backend to emit CLI code
*is* complete and working. It's available right now from GCC SVN. But
it's yet another project, not Google Summer of Code attempts. This
project is backed by STMicroelectronics, a big corporation, probably
for its own use.
http://gcc.gnu.org/projects/cli.html

Remember, Mono doesn't need to be the sole provider of non-Microsoft
CLI tools. :) I believe GCC/CLI can be made to help this project.

Okay, enough said for this mail...

--
Seo Sanghyeon

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] how to change default encoding of string and file at runtime?

2005-12-27 Thread Seo Sanghyeon
On Tue, Dec 27, 2005 at 04:57:32PM -0800, Dino Viehland wrote:
 This is an interesting issue...  If I take your same code and run it
 on CPython it raises an exception: (snip)

Actually, this works when you set defaultencoding.

$ python
Python 2.3.5 (#2, Nov 20 2005, 16:40:39)
[GCC 4.0.3 2005 (prerelease) (Debian 4.0.2-4)] on linux2
Type help, copyright, credits or license for more information.
 s = u'\u6211'
 import sys
 sys.getdefaultencoding()
'ascii'
 str(s)
Traceback (most recent call last):
  File stdin, line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in position 
0: ordinal not in range(128)
 reload(sys)
module 'sys' (built-in)
 sys.setdefaultencoding('gbk')
 sys.getdefaultencoding()
'gbk'
 str(s)
'\xce\xd2'


Hope this help,
Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Crash on method call

2005-11-23 Thread Seo Sanghyeon
With following code, IronPython 0.9.5 crashes with the message
Unhandled Exception: no value for arg.

class C:
def foo(self, arg, bar):
pass

obj = C()
obj.foo(None, bar=1)

Above testcase was reduced from Python standard library's optparse.py,
line 1120, in Python 2.4.2.

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Building IronPython 0.9 with Mono

2005-08-04 Thread Seo Sanghyeon
Hello,

I tried to build IronPython 0.9 with Mono. I used Debian package currently
in Sid to do so.

With attached patch, I succeeded building it, but it doesn't really
run. Transcript follows:

 * * *

[EMAIL PROTECTED]:~/fepy$ mono --version
Mono JIT compiler version 1.1.8.2, (C) 2002-2005 Novell, Inc and Contributors. 
www.mono-project.com
TLS:   normal
GC:Included Boehm (with typed GC)
SIGSEGV  : normal
Globalization: normal
[EMAIL PROTECTED]:~/fepy$ gmcs --version
Mono C# compiler version 1.1.5.0

 * * *

[EMAIL PROTECTED]:~/fepy$ ls
IronPython-0.9.zip  mono-build.patch
[EMAIL PROTECTED]:~/fepy$ unzip -q IronPython-0.9.zip
[EMAIL PROTECTED]:~/fepy$ patch -p0  mono-build.patch
patching file IronPython-0.9/IronPython/Hosting/PythonEngine.cs
patching file IronPython-0.9/IronPython/Modules/__builtin__.cs
patching file IronPython-0.9/IronPython/Objects/PythonFile.cs
patching file IronPython-0.9/IronPython/Objects/ReflectedPackage.cs
patching file IronPython-0.9/IronPython/Objects/StringOps.cs
patching file IronPython-0.9/IronPythonConsole/PythonCommandLine.cs
patching file IronPython-0.9/IronPythonConsole/SuperConsole.cs
patching file IronPython-0.9/makefile

 * * *

[EMAIL PROTECTED]:~/fepy$ cd IronPython-0.9
[EMAIL PROTECTED]:~/fepy/IronPython-0.9$ rm -rf bin
[EMAIL PROTECTED]:~/fepy/IronPython-0.9$ mkdir bin
[EMAIL PROTECTED]:~/fepy/IronPython-0.9$ make
gmcs -warn:0 -t:library -out:bin/IronMath.dll -recurse:IronMath/*.cs
gmcs -warn:0 -t:library -r:bin/IronMath.dll -out:bin/IronPython.dll 
-recurse:IronPython/*.cs
gmcs -warn:0 -t:exe -r:bin/IronPython.dll -out:bin/IronPythonConsole.exe 
-recurse:IronPythonConsole/*.cs

 * * *

[EMAIL PROTECTED]:~/fepy/IronPython-0.9$ mono bin/IronPythonConsole.exe
IronPython 0.9.2042 on .NET 2.0.50215.16
Copyright (c) Microsoft Corporation. All rights reserved.
 1 + 1
System.NullReferenceException: Object reference not set to an instance of an 
object
in 0x00010 IronPython.Objects.Frame:SetGlobal (System.String name, 
System.Object value)
in 0x00067 input_0:Run (IronPython.Objects.Frame frame)
in 0x002b0 IronPython.Hosting.PythonEngine:DoOneInteractive 
(IronPython.Objects.Frame topFrame)
in 0x00064 IronPython.Hosting.PythonEngine:RunInteractive ()


 * * *

Any idea?

Seo Sanghyeon
diff -ur IronPython-0.9.old/IronPython/Hosting/PythonEngine.cs 
IronPython-0.9/IronPython/Hosting/PythonEngine.cs
--- IronPython-0.9.old/IronPython/Hosting/PythonEngine.cs   2005-07-29 
11:21:38.0 +0900
+++ IronPython-0.9/IronPython/Hosting/PythonEngine.cs   2005-08-04 
11:52:59.426015816 +0900
@@ -258,19 +258,10 @@
 if (ExceptionDetail) {
 MyConsole.WriteLine(e.ToString(), Style.Error);
 } else {
-string stack = e.StackTrace;
 MyConsole.Write(e.GetType().ToString(), Style.Error);
 MyConsole.Write(: , Style.Error);
 MyConsole.WriteLine(e.Message, Style.Error);
-string[] frames = stack.Split(new string[] { \r\n }, 
StringSplitOptions.RemoveEmptyEntries);
-foreach (string frame in frames) {
-if (frame.StartsWith(   at IronPython.) ||
-frame.StartsWith(   at ReflectOpt.) ||
-frame.StartsWith(   at IronPythonConsole.)) {
-continue;
-}
-MyConsole.WriteLine(frame, Style.Error);
-}
+MyConsole.WriteLine(e.StackTrace, Style.Error);
 }
 e = e.InnerException;
 }
diff -ur IronPython-0.9.old/IronPython/Modules/__builtin__.cs 
IronPython-0.9/IronPython/Modules/__builtin__.cs
--- IronPython-0.9.old/IronPython/Modules/__builtin__.cs2005-07-26 
03:53:24.0 +0900
+++ IronPython-0.9/IronPython/Modules/__builtin__.cs2005-08-04 
11:54:10.899150248 +0900
@@ -576,13 +576,13 @@
 }
 
 public static double round(double x) {
-return Math.Round(x, MidpointRounding.AwayFromZero);
+return Math.Round(x);
 }
 
 public static double round(double x, int n) {
 if (n  0) { //!!! certinaly imprecise
 double factor = Math.Pow(10.0, -n);
-return factor * Math.Round(x / factor, 
MidpointRounding.AwayFromZero);
+return factor * Math.Round(x / factor);
 }
 return Math.Round(x, n);
 }
@@ -725,4 +725,4 @@
 public static object WindowsError = 
Ops.GetDynamicTypeFromType(typeof(PythonWindowsError));
 #endregion
 }
-}
\ No newline at end of file
+}
diff -ur IronPython-0.9.old/IronPython/Objects/PythonFile.cs 
IronPython-0.9/IronPython/Objects/PythonFile.cs
--- IronPython-0.9.old/IronPython/Objects/PythonFile.cs 2005-07-23 
22:48:06.0 +0900
+++ IronPython-0.9/IronPython