code: def test_no_new_fields_after_init(self):
      class Foo(nnx.Pytree, mutable=True):
          def __init__(self, x):
              self.x = nnx.Variable(x)
  
      foo = Foo(x=1)
      foo.x = 2
  
      with pytest.raises(
          AttributeError, match=r"Cannot add new fields to"
      ):
          foo.y = 2
  
file_path: flax/flax/experimental/nnx/tests/test_pytree.py
imports: from typing import Generic, TypeVar
  import jax
  import pytest
  from flax import serialization
  from flax.experimental import nnx
label_desc: Use image node_id 2 for calling the TestMutablePytree obj's underlying member method code with example usage: obj.test_no_new_fields_after_init() without return types