Releases: nimpylib/npython
Releases · nimpylib/npython
v0.1.2: big updates after adapting to Nimv1/Nimv2
Changelog
[0.1.2] - 2026-04-04
Added
Lib
- sys.exit (5deea42)
Modules
- posixmodule: PyOS_FSPath (bb3a277)
PyTypeObject
- tp_flags; feat(object/attr):
type.__module__(c895633)
Utils
- nexportc.npyexportc (1ae56d7)
- intflags: sup
IntFlags[A|B] & E(05ea1d7) - npointer (pointer(buffer) available in JS with typed IO) (f463b26)
- fileio (2be254c)
- rangeLen from aca732b (e516af2)
- translateEscape from c0a6f74 (27dadb5)
Api
- main accepts init=false (e594cff)
- Py_Initialize, feat(sharedlib): export symbols (ed1975d)
- c: PyLong_FromDouble as newPyInt (1f63db5)
- c: generics: PySequence_Fast_GET_ITEM (24ccb78)
- c: abstract: PyObject_CallMethodObjArgs as callMethodArgs (a681fe2)
- c: PyImport_GetModule (0fd8ddd)
- c: _PyStaticType_InitBuiltin as PyStaticType_InitBuiltin; placeholder: _Py_SetImmortal as Py_SetImmortal (7a0ab01)
- c: _PyUnicode_FastCopyCharacters as fastCopyCharacters... (a45d786)
- c: PyArg_ValidateKeywordArguments, _PyDict_HasOnlyStringKeys as hasOnlyStringKeys (966db9c)
- c: PyObject_GetItem, PyObject_SetItem (cc125f7)
- c: PyCallable_Check as ofPyCallable (0bf985b)
- c: PyLong_AsLongAndOverflow (1727dee)
- c: PyUnicode_FromOrdinal (5a640a3)
- c: generics: PyIter_Next, PyNumber_BOP, PyNumber_UOP, PySequence_List, PySequence_Fast (06296c9)
- c: PyObject_RichCompare[Bool]; add Py_IS_TYPE,etc helpers (dde1dc8)
- c: PyObject_TypeCheck (768384d)
- EXT: PyTuple_Collect (1dff108)
- c: PyUnicode_FSDecoder (e0fce88)
- getargs: PyArg_VaParseTupleAndKeywords, PyArg_ParseTupleAndKeywords (e8ec5dd)
- getargs: PyArg_VaParseTuple (fe79482)
- c: PyRun_Xxx (break: delete runSimpleString) (1c3a83b)
- c: PyParser_XxASTFromXx (4490398)
- c: PrErr_Print[Ex] (a99361c)
- getargs: kwargs: PyArg_UnpackKeywords (4472524)
- dict: pop for PyStrObject (79dafc3)
- set: contains,[containsOr]incl, of[Exact]PyAnySet (c9cad25)
- inner: PyObject_LookupSpecial (a4570dd)
- inner:
_PyObject_CallNoArgsas call (75f496e) - inner: slot func in typeobject/wraps (890a2bf)
- dict.len (be68042)
- forMro, iterMro, forMroNoSelf (mro not impl yet) (7969225)
- str: PyUnicode_CompareWithASCIIString as cmpAscii,
_PyUnicode_EqualToASCIIStringas eqAscii (d2ee91d) - inner:
_PyWideStringList_AsListasasList(850324a) - int: toInt64Unsafe,toBiggestIntUnsafe (8b55f88)
- dict.setItem, Py_BuildValue, Py_gitversion (a63cdd9)
- int: PyNumber_Long, PyLong_FromUnicodeObject (bd2b4e8)
- int: PyLong_FromString (03aac2d)
- PyUnicode_FromFormat as newPyStr&.. or newPyAscii&.. (59a53d6)
- getFullyQualifiedName (252f467)
- PyUnicode_fromStringAndSize, PyUnicode_InternMortal, ofPyTypeObject, isType (f827a82)
- pyerrors.Py_FatalError,Py_CheckSlotResult (af39671)
- newPyList(int) (PyLIst_New) (319fd2d)
- UnicodeVariant.len,
&with char; accept openArray[char] int (af429b4) - structmember: PyMember_GetOne, PyMember_SetOne (e6fb490)
- modsupport: Py_VaBuildValue,Py_VaBuildTuple (89e9468)
- pyatomic (82f9010)
- warnings.warnEx (PyErr_WarnEx) (with TODOs), some new warning type (e40eea7)
- ofExactPyXxObject; add def impl of ofPyXxObject (85b67b8)
- abstract.callMethod; refact: add abstract_without_call (e4ce9ac)
- pairs for Sequence (e5b54f0)
- critical_section (TODO:threads) (63407ef)
- PyFloat_AsXx,asDouble; break: toInt->toIntUnsafe (6e508c9)
- inner: add Python/getargs: PyArg_UnpackTuple,unpackOptArgs (ac5c34b)
- exceptions: checkArgNumAtMost, checkArgNum with min,max;... (a3e538a)
- newPySet(openArray),newPyDict(openArray) (f136c95)
- PyTuple_Pack (a4a500e)
- stringobject: allow init from char|cstring; asUTF8AndSize; substring (43aab68)
- Python/errors PyErr_BadArgument (e63a234)
- PyBoolObject.isPyTrue,newPyList(openArray) (98a7a66)
- toUInt,PyLong_AsSize_t,newPyInt(SomeUnsignedInt) (df05be7)
Attr
- for cell, code, function, method (a739e98)
Attrs
- traceback.tb_next,tb_frame,tb_lasti (29dc943)
Augassign
- impl
a.__iXX__(b)fallback toa=a.__XX__(b)(bd0c158)
Basic
Bltin
- format; feat(magic):
__format__for str,int,float (f5c4356) - float; fix(py):
float.__new__did nothing (9a8402e) - hasattr,setattr,delattr; fix(nimc): PyObject_GetOptionalAttr, PyObject_SetAttr, .DelAttr (9f49275)
Builins
- pow,divmod (0e9ada5)
Builtin
- Ellipsis (ast syntax
...is sup too) (f22a9e3)
Builtins
- complex (ed79d21)
- round; feat(method):
int.__round__(8e0d33e) - method: int_bytes (fd89026)
- globals locals vars (006e433)
- eval (a3e7276)
- exec (3c852e5)
- ascii; fix(py): repr (8837f35)
- method: bytes/bytearray: join (fce6a89)
- bin oct hex (c26d768)
- abs, ord, chr (0760f20)
- any, all (a5310ce)
- filter (51d694c)
- max, min (fcb5116)
- sorted, sum (c59abe1)
- object: list.sort (b3ba8f4)
- input (TODO: not nodejs) (d376b58)
- map (1665607)
- zip (and reg
compilefunc) (e6f90ff) - compile (not reg yet) (0d8a0b7)
- print: sup sep,end kwargs (d47a1b4)
- reg enumerate, reversed; refact: sort registerBltinObject order (eec94e3)
- reversed (not reg yet) (78bfb2e)
- enumerate (not reg yet) (4cc3065)
- object (b4c5086)
- bytes/bytearray: impl at least the same methods as tuple/list (02b51f4)
- sequence: sup method reverse (a09e670)
- sequence: sup magic iadd,mul,imul (398011f)
- str: sup start, end param for index,count,find (c912730)
- getattr, setattr, delattr (1e8e734)
- next (80fa455)
- dict methods except keys,values,fromkeys,update;
__delitem__(f6e919f) - bool; fix(py): neval regarded user-define instance as false (cfed3b7)
- slice (4694fb0)
- NotImplemented (b60b6a0)
Bytes
- bltins, add
__bytes__magic (almost no magic,method impl) (5165105)
C
- api: declarePyType: allow defval (f8de9dd)
- api: overload incl, contains[OrIncl] of set for PyIntObject (ae16a15)
- api: PySys_GetObject, PyLong_FromVoidPtr as newPyIntFromPtr, PyType_GetQualName as getQualName; fixup... (de8eabd)
- api: PyUnstable_Object_Dump (ddd935e)
Class
- single herit (not test) (4ee6304)
Clinic
- impl (156357b)
Comp
- set, dict comprehension (4b00d8c)
Def
- default arguments,
*vargs(b5a6806)
Dict
Err_display
- more py-like, (anchor impl missed) (99cd0fe)
Errors
- ArithmeticError, OverflowError (f6cb789)
Exc
- add almost all; fix(py):
__str__,__repr__,__init__for many exc; fixup: exception attr may be stored as pyNone (dcda6c2)
Exceptions
- OSError, IOError, EOFError, BufferError (decl only) (2e1ae43)
- ModuleNotFoundError, RecursionError; fix: sub base exc dup (cad05a1)
- subclass of BaseException (wip) (7859d0c)
Float
- divmod (inner) (ec6be6e)
Getargs
- acc non-static string as fname (2d82357)
- sup converter as convertVia, kwOnly; fixup for PyArg_VaParseXx (clinic) (42e534a)
- toval sup bool, string (36a4e30)
Gram
- add BYTES token (ac441c3)
ImplMagic
- for binary magic allow typed params (2899ade)
Index
- add url for online demo (6385cf5)
Inner
- PyConfig.import_time (b41217e)
- compat: mayNewPromise (9d06e3a)
- PyTypeObject.member (28f1a80)
- exceptions: add errorIfNot,retIfExc (3432796)
- pyobject: checkTypeOrRetTE, castTypeOrRetTE (cd72950)
- abstract: add helpers:
numAs*OrE,*OptArgAt(fb09b5f) - followup 0039346: sup stop arg for Utils/
sequtils.find*... (3196266) - items,
[]for list,tuple object (ea937c7) - exceptions: obj.isExceptionOf(ExceptionToken) (f7b7285)
- pyobject: declarePyType accepts custom typeName (0ffc98c)
- dedup iterable loop as pyForIn (4066821)
Int
Iterobject
- NimIteratorIter (c867ca9)
Js
- import works when js (6feefbb)
- io works for both node and deno, ... (fb87da3)
- browser (karax) repl (32ec604)
- sup deno; sup -d:jsAlert to gen a prompt&alert repl; sup -d:karax (but bad html style) (3584b6c)
- nodejs repl (1f47848)
- nodejs run .py file (c995cb4)
Karax
- run local .py file (a26b662)
Karaxpython
- ui: wrap line if overflow (f514efd)
- ui: history (bug: cursor not to end on restoring) (98bea33)
- ui: edit line is focused on user entering page (d74eb62)
- add simple info line about repo url (9358d36)
Lexer
- support
\r\nas linesep (102927c)
List
- setitem,deliem accept slice (f9e46c5)
Listcomp
- sup non-simple list comprehension (7b12443)
Magic
- hash for complex (4cbaa25)
- matmul, await,etc, buffer, divmod (not impl for types) (cba512b)
- invert rshift lshift irshift, ilshift (not impl for types yet) (d63dba4)
- del (f030ed0)
- MemberDescr
__get____set__(c35ed86) - iXX (e.g.
__iadd__) (9a400c9)
Members
- slice exceptions funcobject (ff2e3cc)
Meth
- float.hex,fromhex,as_integer_ratio,is_integer (0c97c4c)
- all from pystrutils, unicode_case (a3dd0d1)
- startswith,endswith for str,bytes,bytearray (85b4399)
- bytes/bytearray meth from pkg/pystrutils (a960afe)
- str methods from pkg/pystrutils (d940897)
Method
- dict.fromkeys (f326cda)
- builtin classmethod (01456d1)
- str: join (c15f8b0)
- float:
__abs__(56e4afb) - int: bitwise op,
__abs__(ffdbe39) - str.rfind (fa571a5)
Module
- sys: get_int_max_str_digits, set_int_max_str_digits (dd55fd8)
- sys: xx_info (b6dcd4a)
- sys: excepthook, PySys_EchoStderr, PySys_XxAttr (5db7e40)
- builtins (2b43b46)
- sys (can import as builtin module); feat(import): respect sys.path (31ccd49)
- sys (not all apis) (bafda8e)
- unicodedata.decimal (ef92406)
- sysmodule (audit) (f12258c)
Object
- float: sup mixin ops with float (ae20ee1)...
v0.1.1: adapt to nim v1 or v2
Changelog
0.1.1 - 2025-07-11
Added
Nimble
- task test: support passing arg for subTest (aa489e3)
Changed
Gitignore
- /bin/ (472ac5f)
Nimble
- requires "nim >= 1.6.14" (347937c)
Fixed
Nimc
- get rid of `Error: illegal capture 'args'... followup HEAD~5 (b645cb6)
Error: cannot bind another '=destroy' to: PyCodeObject:ObjectType;impr... (53253bc)- downcast in tuple now must be explicit? (dab5900)
- when gen repr for exceptions:
Error: got prototype: OpenSymChoice 29 "repr"(00e3909) - type mismatch in Python/symtable (2b5efb6)
- get rid of `Error: illegal capture 'selfNoCast' ... (c69dedd)
- nnkTupleConstr used to be nnkPar (a8d5659)
Nimc/js
- no system.outOfMemHook on JS (7c382d7)
Rt
- multimethods is off since 0.20 (a7e26a9)
- grammar:genExpsilonSet: the length of the HashSet changed while iterating over it (296461a)
- lexer:newTokenNode(followup HEAD^) (e6bcaf3)
- grammar:newGrammarNode: assignment to discriminant changes object branch... (43fc39d)