I would like to implement something like default in a switch statement, but for .is choice pgf key. I know that there is an error key handler /errors/unknown choice value but I don't know how to use it. Or may be there is a solution without implementing this handler ?
What I want is when I define for example test/.is choice, to be able to define something like test/.else style={...} that is executed for any test=<unknown choice> with #1 set to <unknown choice> (like if test was not a choice).
\documentclass[tikz,border=7pt]{standalone}
\tikzset{
test/.is choice,
test/1/.style={red},
test/2/.style={blue},
% test/.else style={yellow} <-- how to implement this ?
}
\begin{document}
\begin{tikzpicture}
\fill[test=1] circle(3);
\fill[test=2] circle(2);
\fill[yellow] circle(1); % I would like [test=007]
\end{tikzpicture}
\end{document}
Note: I asked myself this question when I was writing this answer.
EDIT After the answer of @TeXnician I want to specify that I would like to be able to declare something like test/.else style={#1} and then use it like this test=yellow (the parameter is important for me).

#1is not set to007like this. Sorry, my example was not clear :( – Kpym Apr 14 '18 at 08:39\pgfkeyscurrentvaluebut it was not defined ;) – Kpym Apr 14 '18 at 08:58.list={1,...,\pgfkeyscurrentname}is not working, where.list={1,...,#1}is working :( – Kpym Apr 14 '18 at 09:08.unknown/.prefix code={\edef\pgfkeyscurrentchoice{\pgfkeyscurrentname}}and then use\pgfkeyscurrentchoicein place of\pgfkeyscurrentnamein.list={1,...,\pgfkeyscurrentchoice}. – Kpym Apr 14 '18 at 09:29