Add new parametric curve object/type using Python I'm thinking of implementing an add-on (using Python) for Lagrange curves. In short (after an instance has been added), in Object Mode there should just be a curve (i.e. the parametric curve evaluated at a couple of parameter values subsequently connected by line segments) like a Bézier curve, whereas in Edit Mode there should be a control net as well (similar to the control net of a NURBS curve) that allows the user to change/modify the curve. In addition, it should be possible to assign a numerical value to each point/vertex and edge of the control net.

My approach would be to draw the curve using bgl (given a polynomial degree, the values assigned to the edges could act as parameter spans, thereby defining Lagrange basis functions — any position on the curve can then be computed as the sum of the control points multiplied by their associated basis functions). However, I'm not sure how to make the curve into an actual object (such that it can be selected, saved, ...). In addition, it should still be possible to change the resolution of the curve at a later time.

Next, how/where to store the control net and additional information? My approach would be to create a mesh for this purpose and store values in a bmesh layer. In Object Mode this mesh should be hidden. But how to link it to the curve (changing values re-defines the basis functions which should result in a different curve, likewise moving control points should change the curve)?

I realize this is a rather comprehensive question -- I'm fairly familiar with bmesh but apart from simple scripts I don't have much experience coding things in Blender. Any thoughts on a general workflow (see steps/outline above) or references to similar add-ons would be much appreciated!
There is an extra objects addon that provides a 3d function surface that should help with how to create the mesh.

For the showing the surface in the viewport I would look at CGCookies retopology tools. If you watch the demo video you will find they draw a preview over the mesh object before creating the final mesh data.

You might want to look at the PropertyGroup or Collection types as a way to add extra data to an object.

There is a chance you may be asking too much for python, maybe you need to consider it as a patch to be added to blenders main source code.