Subject: [FFC-dev] Python 2.3 compatibility

From: Johan Jansson <[email-masked]>
Date: Tue, 23 Jan 2007 01:52:22 +0100

Hi!

An incompatibility with Python 2.3 seems to have been introduced
recently. This is the output from "ffc Poisson.form" with changeset
503:891e9a91f4d0 (Thu Dec 21 15:40:01 2006) and Python 2.3.4:

...
    __build_form(form, format, options)
  File "/afs/nada.kth.se/home/o/u1mb1o3o/usr/lib/python2.3/site-packages/ffc/compiler/compiler.py", line 174, in __build_form
    cK_used  = set()
NameError: global name 'set' is not defined

Does a compatibility "set" module exist for 2.3, or is there another
solution?

  Johan

---

From: Andy Terrel <[email-masked]>
Date: Mon, 22 Jan 2007 20:21:10 -0600

there is the Sets module in 2.3

http://www.python.org/doc/2.3/whatsnew/node2.html

the set didn't become a standard type until 2.4.  Although I think if we 
wanted to provide a rudimentary set function, it would not be so hard to do.

Andy

Johan Jansson wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev
>

---

From: Anders Logg <[email-masked]>
Date: Tue, 23 Jan 2007 09:50:17 +0100

I used the set module before but recently switched to the built-in
set for no particular reason. I just thought since 2.5 is out, I didn't
need to keep compatibility with Python 2.3, especially since I wasn't
sure I was compatible with Python 2.3 elsewhere.

Do you need FFC to work with Python 2.3?

/Anders

---

From: Johan Jansson <[email-masked]>
Date: Tue, 23 Jan 2007 12:27:37 +0100

> Do you need FFC to work with Python 2.3?

Ok, if it's an easy fix I think it would be good to keep Python 2.3
compatibility for 6-12 months more. The latest Red Hat Enterprise
Linux (which we use at KTH, RHEL 4) doesn't include Python 2.4 yet,
and neither does Max OS X as far as I can see.

  Johan

---

From: Anders Logg <[email-masked]>
Date: Wed, 24 Jan 2007 13:33:21 +0100

> and neither does Max OS X as far as I can see.

Sounds strange since even 2.5 has been out for a while, but I'll try
to use the set module.

/Anders