This is a follow-up question to my previous question on "winding numbers" of curves in higher-dimensional space. I thought it best to post a new question rather than changing the setup of the previous one from the ground... The comments and answers there suggest that in this case the point of view (pun intended) shouldn't be a point, but really a higher-dimensional object. So, what we are really looking for is $w(\gamma,X)$, the number of windings of a loop $\gamma$ around an appropriate topological subspace $X\subseteq\mathbb{R}^n$ (to be determined).

*Example 1.:* Let $L$ be a line and $X:=C:=\mathbb{D}^2\times L$ a solid cylinder in $\mathbb{R}^3$. Then *intuitively* $w(\gamma,C)$ should be determined by the homotopy class of $[\gamma]$ in $\pi_1(\mathbb{R}^3\setminus C)$. But I believe this example to be misleading.

*Example 2:* Let $X:=\mathbb{S}^2$. *Surely* we can count how many rounds/loops a yarn $\gamma$ makes around $X$, even though $\pi_1(X)=0$. It seems $w(\gamma,X)$ shouldn't always be homotopy-invariant.

Is there a reasonable way to formalize the intuitive notion of number of windings of a loop $\gamma$ around $X$, where $\gamma\cap X=\emptyset$, for a suitable class of topological spaces $X$?

For instance, in $\mathbb{R}^2$ the classical winding number $w(\gamma,a)$ would correspond to $w(\gamma,C_\varepsilon(a))$ for a small circle around $a$. (It's perhaps that second argument that should always be homotopy-invariant?)

*a cat: NORTH AMERICAN *informal* (especially among jazz enthusiasts) a man.