views:

187

answers:

4

I'm interested in learning python to have access to a more agile language for writing tests in my .NET projects.

Is IronPython mature enough for these purposes yet? I'm content with writing tests in C#, but find dynamic languages like ruby and python very attractive. Would it be better to forgo IronPython while learning, and stick to the official version 3 distribution?

I'd be interested to hear from anyone that has had success writing tests for a .net project in ironruby or ironpython.

Edit: reworked my question to address the real issue about using dynamic languages for TDD in .NET - the version issue isn't as important. Apologies for the poorly worded question.

A: 

What I've found however, is that IronPython to the best of my knowledge appears to be based on Python v2, while many of the learning resources available on the web are focused on Python v3.

I don't know what resources you've been looking at, but the majority of them are for v2.

Unknown
A: 

The biggest difference you'll find between Python 2 and Python 3 is the print statement.

Python 2:

print "Hello world"

Python 3:

print("Hello world")

I'm not sure where you're looking to find all those Python 3 learning resources, but there are zillions of learning resources for Python 2 still out there.

Greg Hewgill
A: 

"Is IronPython mature enough for these purposes yet?"

The snarky answer is "obviously", since it's a first-class part of visual studio.

http://search.microsoft.com/results.aspx?mkt=en-us&setlang=en-us&q=ironpython

A better answer is "yes". It really works, has really worked for years, and is compatible with other Python run-times that have worked for many, many years.

Here are the instructions: http://www.microsoft.com/downloads/details.aspx?FamilyId=55932211-0D7E-4C6E-9B18-8F9D2AC1EE43&displaylang=en

"Would it be better to forgo IronPython while learning, and stick to the official version 3 distribution?"

This doesn't make much sense.

You're working in .Net, so IronPython is your best choice. The "forgo IronPython" is hard to parse -- are you thinking of using CPython? It works, also. And works well, but it might not work well with your other visual studio tools.

"stick to the official version 3 distribution" makes no sense at all. There are two parallel distributions, both official. There's 2.6 and 3.x. They will both exist in parallel for the foreseeable future.

You should start with whatever version works with the tools you want to use. At the present time, your tools probably work better with 2.6 than 3.x. At some point, you'll notice that your tools are migrating to 3.x. Then -- and only then -- you can migrate to 3.x.

S.Lott
AFAIK it's not straightfoward to integrate IPy and VS. There is something as part of the VS SDK, which lets you do that, but that's only for IPy 1.x.x. See http://code.msdn.microsoft.com/IPyDD
Rohit
"since it's a first-class part of visual studio." That's just not true. There's an abandonware project which sort of integrates a previous version of IPy with VS. It hasn't been updated for over a year.
Will Dean
I have both VS2005 and VS2008, and IPy support does not come by default. I'm not sure how you can call IPy a first class entity. I downloaded and installed the IPy integration, pointed by the link, but still I don't have any proper support (no syntax highlighting etc). Do you have it working with VS? If yes, please show me how.
Rohit
+2  A: 

As others have said, most of the resource on line are still for Python 2.x. I'd start at the official tutorial. If you prefer videos, showmedo has a large collection of tutorials. Python 3.x isn't really production ready yet.

IronPython is very mature, this blogger works at Resolver Systems, a company that wrote an entire spreadsheet program in IronPython.

They use test driven development extremely extensively, so I'd say that's a success story for TDD using IronPython, although the system under test wasn't written in C#.

Ryan