The page numbers in a table of contents often sit far to the right of the titles. Since we rarely look at a table of contents from top to bottom, and often from left to right, it might be better to have the numbers sit next to the title. What is a simple way to make this happen in the amsart class?

\documentclass{amsart}
\usepackage{blindtext}
\usepackage{enumitem}
\title{}
\begin{document}
\maketitle
\tableofcontents
\begin{center}
\textsc{Contents} \\[6pt]
\begin{minipage}{7cm}
\begin{enumerate}[label=\arabic*.]
\item My childhood theorems, 1
\item Theorems from my adolescence, 2
\item Graduate theorems and my thesis, 4
\end{enumerate}
\end{minipage}
\end{center}
\section{My childhood theorems} \blindtext[5]
\section{Graduate theorems and my thesis} \blindtext[5]
\end{document}


I tried the following:

\begin{center}
\begin{minipage}{8cm}
\begingroup
\def\hfil{,\relax}
\tableofcontents
\endgroup
\end{minipage}
\end{center}


Not a bad idea at all. Bringhurst says we don't have to add up the page numbers, so why should they be in a column far away from the title?

You can modify the working of \@tocline; for centering the table of contents, assuming it fits in one page, you can use varwidth.

\documentclass{amsart}
\usepackage{varwidth}
\usepackage{blindtext}

\makeatletter
\def\@tocline#1#2#3#4#5#6#7{\relax
\ifnum #1>\c@tocdepth % then omit
\else
\begingroup \hyphenpenalty\@M
\@ifempty{#4}{%
\@tempdima\csname r@tocindent\number#1\endcsname\relax
}{%
\@tempdima#4\relax
}%
%    \rightskip\@pnumwidth plus4em \parfillskip-\@pnumwidth
#5\leavevmode\hskip-\@tempdima #6\nobreak\relax
,~#7\par
%    \hfil\hbox to\@pnumwidth{\@tocpagenum{#7}}\par
%    \nobreak
\endgroup
\fi}
\makeatother

\begin{document}
\title{Whatever}
\maketitle

\begin{center}
\begin{varwidth}{\textwidth}
\tableofcontents
\end{varwidth}
\end{center}

\section{My childhood theorems}
\subsection{Whatever}
\blindtext[5]