My question is related to Theorem 4.1.8 from these lecture notes. Let $X$ be an algebraic variety (you can check the definition of algebraic variety I am using in Definition 4.3.4). Let $x\in X$ be a point in my variety. Then there is an open neighbourhood $U$ of $P$ such that $(U,\mathcal{O}_X|_U)$ is isomorphic to a $(Y,\mathcal{O}_Y)$ for some $Y\subset \mathbb{A}^n$ (i.e. such that $(U,\mathcal{O}_X|_U)$ is an affine variety, is this correct?). Then without loss of generality assume that $U$ is itself the closed subset of $\mathbb{A}^n$. Then $\mathcal{O}_X|_U(U)$ are only polynomials, right? For the record, my lecture notes define $\mathcal{O}_X|_U(V)=\mathcal{O}_X(V)$, where $V\subseteq U$. So the regular functions on an open set $U$ are "like" polynomials if $U$ with its sheaf of functions is one of those open sets isomorphic to an affine variety, and something else otherwise.
About this something else, I go back to Definition 4.1.1, which tells me that the remaining regular functions are quotients of polynomials. So is this how regular functions work on algebraic varieties? On open sets that lead to an affine variety structure they are polynomials and on the rest of open sets they are quotients of polyomials?