Asnake

Latest version: v0.13.39

Safety actively analyzes 623383 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.12.0

0.11.0

**Optimizations:**
_- When calling empty dict() or list(), will generate a empty dictionary or list instead:_
py
x = dict() --> x = {}
y = list() --> y = []


_- Loops which call only one function on a iteration now transform into maps:_
py
loop 12 i to func

_Turns into:_
py
list(map(func, range(12)))

_The list( is needed in order to actually execute the function calls._

_- For loops appending to lists while calling a function now transform into maps:_
py
for x in thing: myList.append(func(x))

_Turns into:_
py
y = list(map(func, thing))


_- Pure functions now receive a (depending on python version) cache or lru_cache decorator which provides a great speedup to that function._

_- not not var is faster than bool(var), so it replaces that instance. Also works with pipes._

**Fixes:**
_- Accepts hexadecimal numbers more properly_

_- is syntax now correctly triggers len function when comparing string and int_

_- Builtin Python functions will now call without ()_

_- Can use type declaration and const syntax in either order._
py
const int num 12
acts the same as
int const num 12


**Breaking changes:**
_- When using a increment/decrement on a while loop, var++ will apply at the end of a iteration, and ++var will apply at the start of an iteration._

**Features:**
_- Can specify which Python version to compile to via Meta instead of compiler flag:_
py
$ pythonVersion = 3.7

_Use multiple times to create sections of the code that compile to different versions._

**General conclusion:**

This version of ASnake is the first to go open source. While few have contributed, it has meant that at least sometimes people use it, and thus rely on it. That has created some good habits to increase stability, and hence the amount of commits for this version.
However, I must move on and introduce more features to the language, increasing the reasons anyone should care about it all.
In the next release I plan on implementing:

- Default print on expressions with functions when inside an f-string, or being operated on.
- Accept and ignore >>> as syntax. Makes copy pasting from terminal easier, and confuses beginners less. Potentially should result in compiler warning (not error).
- Meta for making function not require parenthesis, like expression print.
- Python3.10 support

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.