# Python serialization - inlining of functions not very readable?

**URL:** <https://forum.makecode.com/t/python-serialization-inlining-of-functions-not-very-readable/9084>\
**Category:** PXT\
**Created:** [July 6, 2021, 3:06am UTC](https://forum.makecode.com/t/python-serialization-inlining-of-functions-not-very-readable/9084 "2021-07-06T03:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfo8000](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jfo8000/32/1038_2.png) [@jfo8000](https://forum.makecode.com/u/jfo8000)\
**Post date:** [July 6, 2021, 3:06am UTC](https://forum.makecode.com/t/python-serialization-inlining-of-functions-not-very-readable/9084/1 "2021-07-06T03:06:23Z")

</div>

I am pretty excited because I just turned on python serialization for the BuildBee MakeCode pxt  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/73f3761acb33f897caa7b2b8c1f407185c275997.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/5fc9d2e58da111a59850fd89a619c051f7c412f7.png)

So far it seems to be working well. It gets a little weird for my blocks that take a function though  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/500b80380e4990b2955ce072773e2a19420d8cc0.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/443d6f49385388f9d82c3705d3ede5cc56459cb8.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/42af178c58c8c9a20f78b72fd7f693839447f820.png)

Any suggestions how to clean this up? When I do typescript it has the ability to use lambda expressions, so the code looks tidier

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/cfe35e83daf43762501ed91567974eb96a55c967.png)

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 6, 2021, 9:20pm UTC](https://forum.makecode.com/t/python-serialization-inlining-of-functions-not-very-readable/9084/2 "2021-07-06T21:20:11Z")

</div>

Python’s lambda expressions aren’t as good cause braces don’t exist, so you are kinda stuck with nested functions. Also I believe the lambda statement doesn’t work in PXT at all currently.

---

<div class="post-metadata">

**Author:** ![willadams](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/willadams/32/5567_2.png) [@willadams](https://forum.makecode.com/u/willadams)\
**Post date:** [January 31, 2022, 6:00pm UTC](https://forum.makecode.com/t/python-serialization-inlining-of-functions-not-very-readable/9084/4 "2022-01-31T18:00:40Z")

</div>

When one writes out Python from [makecode.buildbee.com](http://makecode.buildbee.com) what does one do w/ it?

Is it compatible w/ PythonOCC or one of the other Python code 3D modeling tools?

Will you work up a module which can be imported, so that when the Python code is run one gets a .stl of the 3D model created?
