# PythonNET parser has incorrect py3 syntax errors

**URL:** <https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455>\
**Category:** AlterNET Studio Support\
**Tags:** python\
**Created:** [April 10, 2024, 11:59pm UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455 "2024-04-10T23:59:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamish](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/h/606060/32.png) [@Hamish](https://forum.alternetsoft.com/u/Hamish)\
**Post date:** [April 10, 2024, 11:59pm UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/1 "2024-04-10T23:59:21Z")

</div>

Hi,

When using the lambda python keyword the PythonNETParser/TextEditor is incorrectly highlighting these as syntax errors.

![image](https://forum.alternetsoft.com/uploads/default/original/1X/dd5c017f981cff641cd35320ccc2acff74af2bc5.png)

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [April 11, 2024, 9:03am UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/2 "2024-04-11T09:03:14Z")

</div>

Hi Hamish,

Thank you for reporting this issue. We have fixed it internally, and the fix will be included in the next minor update (which we aim to release next week).

I will keep you posted once we release it.

Kind regards,  
Dmitry

---

<div class="post-metadata">

**Author:** ![Hamish](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/h/606060/32.png) [@Hamish](https://forum.alternetsoft.com/u/Hamish)\
**Post date:** [May 7, 2024, 6:30am UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/3 "2024-05-07T06:30:58Z")

</div>

Hi Dmitry,

We’ve also noticed some other syntax highlighting issues with the PythonParsers when using list comprehensions with the ternary if statements.  
 ![image](https://forum.alternetsoft.com/uploads/default/original/1X/a110569d71bcf9a39b94ffee33ef4dac78ba14c7.png)

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [May 17, 2024, 8:48am UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/4 "2024-05-17T08:48:48Z")

</div>

Hi Hamish,

Sorry for the delay in response. I looked at our source code, and while we support parsing comprehensions with the for statements, if statements are not there yet.

We will fix it shortly and include it in the next week’s update.

Kind regards,  
Dmitry

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [May 22, 2024, 7:20am UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/5 "2024-05-22T07:20:09Z")

</div>

Hi Hamish,

We’ve just released an update (9.5.5), which is available via [NuGet](https://www.nuget.org/profiles/Alternet), where this issue should be addressed.

Kind regards,  
Dmitry

---

<div class="post-metadata">

**Author:** ![Hamish](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/h/606060/32.png) [@Hamish](https://forum.alternetsoft.com/u/Hamish)\
**Post date:** [May 23, 2024, 3:04am UTC](https://forum.alternetsoft.com/t/pythonnet-parser-has-incorrect-py3-syntax-errors/455/6 "2024-05-23T03:04:03Z")

</div>

Great thanks Dmitry!
