New features
============
This release is by far the most important one in the now long history of
Brython: 384 commits, 181 files changed, 54.000 additions, 28.000 deletions.

The main change is a complete rewriting of the built-in types implementation.
This is detailed in a dedicated [Wiki page](https://github.com/brython-dev/brython/wiki/New-builtin-types-implementation-2026).

Arguments parsing for built-in functions and methods has also been rewritten.


Implementation
==============
- add JS convenient function loadBrythonPackage (by Florent Gallaire)
- rewrite internal IO classes
- remove JSObj.__str__, only leave __repr__ (would break printing of
  javascript.Array)
- encoding 'locale' is translated to 'utf-8'
- improve import of JS modules included in a Virtual File System such as
  created by `brython-cli make_package <package-name>`. Related to PR #2623
- replace `window` by `globalThis`
- rewrite constructor of function objects (FunctionType(code, globals))
- improve reporting in case of error in annotate function
- add a function __BRYTHON__.importModule() to replace getPythonModule and
  importPythonModule. Related to issue #2625
- major rewriting of Exception implementation. Don't generate
  ExcClass.$factory in $B.make_builtin_exception with hacks for exceptions
  that take specific arguments; use inheritance and write specific __new__ and
  __init__ methods for exceptions with a specific behaviour. Use internal
  functions $B.RAISE, $B.EXC and $B.RAISE_ATTRIBUTE_ERROR.
- rewrite implementation of code.co_positions
- in "from module import x", if something else than an ImportError happens,
  raise it
- improve support of array.array instances in operations on bytes and
  memoryview
- implement float.from_number
- mmemoryview: add descriptor nbytes, methods release, __enter__ and __exit__
- add _BufferedIOBase.close()
- in object.__reduce_ex__, if object has __getstate__ method, use it to build
  the state
- add method bytearray.resize(), new in Python 3.14
- add __getstate__ and __setstate__ to StringIO, rewrite implementation of
  BytesIO
- when an object is passed to memoryview(obj), set internal attribute
  obj.$export to 1. This prevents bytearray from resizing, until the
  memoryview object is deleted or its method release() is called
- for 'del obj', if obj has a method __del__, call it
- memoryview: fix bug in release(); upon creation, add object to
  frame.need_delete, so that method release is called when leaving the frame
- in py_bytes.js, check that a bytearray is not currently used by a
  memoryview before applying modifying methods
- add function $B.need_delete(obj) to mark the object as having to be
  explicitely deleted when leaving an execution frame. Use it in
  leave_frame(). Currently used by memoryview.
- raise appropriate error when setting an attribute with a descriptor that has
  no setter function
- generate code for object deletion when a name is reassigned in the same
  scope. Required for objects that have a __del__ method such as memoryview.
- add js_array.__delitem__
- in py_dom.js, don't raise an exception in DOMNode.__del__ if the node has
  not yet been inserted in a parent node (side effect of reassigning names in
  the same namespace, which calls __del__ on the previous value)
- add function $B.delete_for_reassign, called when a name is reassigned in the
  same namespace (calls __del__ on the previous value)
- replace error.$factory(msg) by $B.EXC(error, msg)
- apply repr() by default when processing debug f-string expressions like
  f"{x=}" (by Djoume Salvetti)
- add __buffer__ and __release_buffer__ to bytearray and array.array
- in py_utils.js/rich_comp, for eg a == b, correctly handle the case where
  type(a).__eq__ is an instance of a descriptor class.
- js_objects.js : add or fix js_array methods
- when reassigning a name that previously held a DOMNode instance, don't call
  __del__ because it would remove the element
- add __code__ attribute to functions defined in JS modules
- implement attribute resolution as explained in the Descriptor Guide
- mark Python functions with ob_type to avoid confusion with JS functions
- replace `$B.call(callable)(...args)` by `$B.$call(callable, ...arguments)`
- in attribute resolution, use slots (eg tp_new) wherever possible instead of
  attributes (__new__). Use this in call, str, type.tp_new, etc.
- implement class dictionaries as Python dicts instead of JS objects.
- rewrite all built-in types with slots (eg.tp_new), methods in tp_methods,
  get/set functions in tp_getsets, etc.
- add object.__subclasshook__
- initialize module namespace to $B.imported[module_id] if it exists, else to
  {}
- set frame attribute $has_generators when a generator is called inside it
- change implementation of int: represented by a JS "number" or "bigint".
  Brython-specific type long_int is no more necessary.
- rewrite js_objects.js, use standard Python mechanisms as much as possible
- search object attributes only as obj.__dict__[attr], no more as obj[attr]
- more complete implementation of the Template type (PEP 750)
- optimize attribute resolution by setting an attribute $getattribute to each
  type, taking into account the existence or not of __getattribute__ and
  __getattr__ in the type and its parents
- don't stop execution of page loading if a Python script fails. Related to a
  discussion on the Google group "Modest proposal"
- rewrite builtins modules so that builtins.__dict__['open'] is the builtin
  open()
- speed improvements for attribute resolution
- wrap gen_parse.js code in a self-executing anonymous function to avoid
  pollution of the global Javascript namespace
- set javascript.UNDEFINED to undefined, not $B.Undefined
- simplify $B.$is
- improve speed of str.split(), str.splitlines(), str.startswith()
- use TPFLAGS to replace $B.$isinstance(x, cls) by faster versions for common
  types ($B.is_int(x), $B.is_str(x), etc.)
- don't set function __dict__ when created, wait for the first time it is
  requested
- on class creation : don't call __set_name__() on some internal class
  attributes (__first_lineno__, __static_attributes__ etc.); only call
  __init_subclass__ if it's not object.__init_subclass__

- add core Brython script finalize_builtin_types.js: use type slots to
  initialize built-in types dict
- add core script init_builtin_types.js with code to initialize all the
  built-in types before starting detailing their contents in next core scripts

- put all io-related code in py_builtin_functions.js in a new core script,
  py_io.js. Adapt all the html pages that load the core scripts.
- move all descriptors to a new core script "descriptors.js". Update all HTML
  pages
- move memoryview definition in a new script memoryobject.js
- move type "code" to new script py_code.js
- move eval / exec to new script py_eval_exec.js
- remove py_long_int.js
- move classmethod and staticmethod from py_type.js to py_functions.js

Internal tools
==============
- add a script to check that the latest version is in the list of
  documentation versions. Related to issue #2618
- put list of core scripts in a separate module core_scripts, use it in
  make_dist.py
- add a script to normalize the HTML lines when Brython core scripts are
  loaded in the page, instaed of brython.js. Apply this script to all the HMTL
  files in the repository
- add scripts that generate /src/builtin_type_info.js, with code to copy/paste
  into core Brython scripts for types. Use CPython repo to get built-in types 
  slots

Bug fixes
=========
- fix bug in error message when creating a class with an unacceptable base type
- str.split() returns Python lists, not JS arrays
- fix StringIO missing 'closed' attribute
  StringIO.__init__ was not initializing the 'closed' attribute, causing
  AttributeError when accessing it. BytesIO correctly initializes this.
  Added `$.self.closed = false` to match BytesIO behavior.
  (by Djoume Salvetti, Co-Authored-By: Claude <noreply@anthropic.com>)
- fix bug when a debug f-string (f"{x=}") has single quotes in x
- fix quadratic time idna decoding (by Ivana Clairine)
- fixes repr of dict.keys(). Related to issue #2672
- bug in float.__getformat__

Issues
- #2613 : mock_open default MagicMock is missing methods available on standard
  file handles
- #2615: fix strftime('%I') at midnight
- #2614 : calling __init__ with extra kwargs does not raises TypeError
- #2619 : str() does not appropriately raise type error
- #2620 : inside a function, if a module name is declared global,
  `import module` adds the name in locals instead of globals
- #2622 : inconsistent platform name
- #2624 : broken support of typing NamedTuple in brython 3.14.0
- #2632 : TypeError: SEQ is not iterable on stdlib import (enum/re/random:
  stdlib I mean) specific to Firefox 145.0
- #2633 : 'MagicProxy' object is not callable
- #2636 : json.loads('') throws JavascriptError instead of JSONDecodeError
- #2637 : invalid json does not raise JSONDecodeError (by Djoume Salvetti)
- #2641 : adding to a MagickMock causes JavascriptError
- #2644 : abstract class error message format matches Python 3. Update
  TypeError message when instantiating abstract classes to match Python 3's
  format: "Can't instantiate abstract class X without an implementation for
  abstract method(s) 'y', 'z'" (by Djoume Salvetti, Co-Authored-By: Claude
  <noreply@anthropic.com>)
- #2646 - MagicMock(spec=...) now works correctly (by Djoume Salvetti,
  Co-Authored-By: Claude <noreply@anthropic.com>)
- #2650 : dict.setdefault with non-string keys on string-only dicts
  (by Djoume Salvetti, Co-Authored-By: Claude <noreply@anthropic.com>)
- #2652 : descriptor __delete__ not being called (by Djoume Salvetti,
  Co-Authored-By: Claude <noreply@anthropic.com>)
- #2658 : integer-float comparison discrepancy
- #2659 : string __doc__ attribute not set to NoneType during runtime
- #2661 : int('-') and int('+') not raising ValueError
- #2669: float % int fails
- #2670 : passing a method as an event handler into window.bind() causes
  errors
- #2671 : event handlers assigned directly do nothing
- #2673 : HTML elements convert to bool as false
- #2674 : new string split() bug
- #2675 : the unbind and removeEventListener methods do not work on Web
  Components
- #2676 : new hex parsing error (restore strict mode for brython.js; in
  non-strict mode, the arguments object was modified in int.$factory)
- #2677 : creating a defined Web Component using the createElement method
  results in an Uncaught error

Brython site
============


Github site
===========


Demos
=====
- JavaScript/Python bridge demo (by Florent Gallaire)
- drum score demo : add volume control
- move code of the 15-puzzle demo in a separate Python script taquin.py

Standard distribution
=====================
- add fake _opcode module (required by test.support)
- add attribute sys._jit
- improve __repr__ of array.array instances
- add stdlib module _pyio
- add package string

Documentation
=============
