# Changes in Python?

**URL:** <https://forum.dynamobim.com/t/changes-in-python/2919>\
**Category:** Developers\
**Created:** [January 13, 2016, 12:06pm UTC](https://forum.dynamobim.com/t/changes-in-python/2919 "2016-01-13T12:06:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [January 13, 2016, 12:06pm UTC](https://forum.dynamobim.com/t/changes-in-python/2919/1 "2016-01-13T12:06:42Z")

</div>

Hi

I would like to ask if there are some changes in Python in Dynamo 0.8 and 0.9 compared to 0.75.

I have a script which worked just fine in 0.75 but doesn’t work in 0.8 and 0.9

 ![2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e21740ddf8ae29402840d740265aab1b0567ecbf.jpg)

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [January 13, 2016, 2:17pm UTC](https://forum.dynamobim.com/t/changes-in-python/2919/2 "2016-01-13T14:17:40Z")

</div>

Couple of things:

&nbsp;

1. You open a Transaction but never commit it. Please make sure that you close a transaction at the end of your script.
2. Your inputs E and N. If they are lists, then this method doesn't work for unwrapping them. What it does, it unwraps a whole list into a list object.

&nbsp;

Check those out.

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [January 13, 2016, 10:23pm UTC](https://forum.dynamobim.com/t/changes-in-python/2919/3 "2016-01-13T22:23:33Z")

</div>

Technically UnwrapElement does work on lists but with one major drawback - the output is not a python list object. It says it’s a list but it behaves as a tuple:

 ![Dynamo_2016-01-14_11-49-47](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e64e9f80c72e1171115871e835ffaa73ec36f19a.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

If I try to append something, l2 fails:

![Dynamo_2016-01-14_11-50-24](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d0476522cd6f0bbcf5eb89be23f078301ad82b66.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

 ![Dynamo_2016-01-14_11-50-15](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/42d20be18bf038010025337c9556aaffbf46e2d3.png)

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [January 14, 2016, 1:26am UTC](https://forum.dynamobim.com/t/changes-in-python/2919/4 "2016-01-14T01:26:33Z")

</div>

Thank you both for your suggestions. Are there any changes in the API though? I still can’t make it run. I am trying to join multiple objects to a single one.

[join](http://dynamobim.org/wp-content/uploads/forum-assets/viktor-kuzevgmail-com/01/14/join.dyn) ![Capture](http://dynamobim.org/wp-content/uploads/forum-assets/viktor-kuzevgmail-com/01/14/Capture.png) join

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [January 14, 2016, 8:26am UTC](https://forum.dynamobim.com/t/changes-in-python/2919/5 "2016-01-14T08:26:28Z")

</div>

When I said that you can’t unwrap a list of elements like that i didn’t mean that you don’t have to unwrap them at all. you do. just iterate through the list:

if isinstance(IN[0], list):

unwrappedList = [UnwrapElement(i) for i in IN[0] ]

else:

unwrappedList = [UnwrapElement(IN[0])]

&nbsp;

that’s for a flat list. if you have a nested list of elements, you would need a function and then map over it.

Dimitar,

Yes, that’s what I meant. It unwraps the whole thing into a single object that is not a Python list. 🙂

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [January 18, 2016, 1:34am UTC](https://forum.dynamobim.com/t/changes-in-python/2919/6 "2016-01-18T01:34:57Z")

</div>

Thanks.

I’ll give it a try. I’m pretty sure though that previously I’ve used this same piece of Python script successfully using lists as imports.
