Skip to content

Releases: nimpylib/npython

v0.1.2: big updates after adapting to Nimv1/Nimv2

04 Apr 16:39

Choose a tag to compare

Changelog

[0.1.2] - 2026-04-04

Added

Lib

Modules

  • posixmodule: PyOS_FSPath (bb3a277)

PyTypeObject

  • tp_flags; feat(object/attr): type.__module__ (c895633)

Utils

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_CallNoArgs as 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_EqualToASCIIString as eqAscii (d2ee91d)
  • inner: _PyWideStringList_AsList as asList (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 to a=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

Builtin

  • Ellipsis (ast syntax ... is sup too) (f22a9e3)

Builtins

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

Comp

  • set, dict comprehension (4b00d8c)

Def

  • default arguments, *vargs (b5a6806)

Dict

  • popitem (c737859)
  • all meth except fromkeys,popitem; fix(py): dict() accepted no arg (904c9ce)

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

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

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

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

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\n as 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

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)...
Read more

v0.1.1: adapt to nim v1 or v2

04 Apr 16:42

Choose a tag to compare

Changelog

0.1.1 - 2025-07-11

Added

Nimble

  • task test: support passing arg for subTest (aa489e3)

Changed

Gitignore

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)

Warning

  • [UnusedImport] of inner libs (26b39ac)
  • [UnusedImport] of stdlib; and a dup import (0d6c748)
  • [Deprecated] in pkg/regex: re,find shall be suffixed by '2' (510ca46)
  • [Deprecated] in system/stdlib:... (5a90c4a)