If you come to France without the right papers and you want to get French citizenship, then it's really quite simple.
As the case of Mamoudou Gassama goes to show, all you have to do is pull off something "exceptional".
Actually that is not being flippant. It is in the civil code.
Article 21-19 says that a fast-track naturalisation procedure is possible for a foreign national who has "performed exceptional services for France, or whose naturalisation would be of exceptional interest for France".
This is what President Emmanuel Macron was invoking when he congratulated the young Malian at the Elysée palace and told him his papers would be in the post.
Being a nation founded on a set of self-declared values, France has always been open to the idea of an "honorary" French citizenship - a way of elevating worthy foreigners whose actions have defended or propagated those values.
Back in the early days of the Revolution, there was a law that gave citizenship to "men (sic) who by their writings and their courage have served the cause of freedom". Beneficiaries included George Washington and Thomas Jefferson.
Much later, in 1870, a decree offered citizenship to people who had fought alongside France in the war against Germany. Most of those who benefited at the time were actually Germans.
And of course there is also the special case of the Foreign Legion, which since the 1830s has offered a chance to fight for France to soldiers of other nations.
Contrary to popular belief, Foreign Legion soldiers do not get automatic French citizenship, except if they are wounded in action. Today - with the legion employing 8,600 soldiers from 150 countries - there are about 200 naturalisations a year.
But all these precedents were set in the days before mass immigration. Today it is different.
Today there are hundreds of thousands of young men in France who - like Mr Gassama - arrived after a long and dangerous journey, have no proper papers and survive (just about) by working in the black economy.
And all of them would dearly love to follow his example.
In such circumstances there was bound to be heavy scrutiny of the president's decision.
In fact, just about everyone agrees that what Mr Gassama did in saving the boy was sufficiently extraordinary to merit fast-track citizenship.
But what some people hold against the president is inconsistency.
Why, his detractors are asking, do you not apply the same generosity to the rest of the sans-papiers (paperless ones) - all those other Mamoudou Gassamas whose daily misery goes unreported? Why single out one lucky individual?
Their indignation is all the sharper because right now an immigration bill is passing through parliament which - in the eyes of the left - puts President Macron clearly in breach of France's historic mission to humanity.
Whether his proposed law is nearly as tough or inhumane as his enemies say it is is another matter.
What is not in doubt is the goal: it is to make matters as clear as possible, as early as possible, to would-be immigrants. If they can stay, they stay. If they have to leave, they leave. They are deported.
In his conversation with Mr Gassama, President Macron made clear that had it not been for his chance encounter with a badly supervised child on a hot day, Mr Gassama himself would have been on that list for deportation.
But things turned out differently. Mr Gassama reacted with an instinctive generosity of spirit, he performed an act of supreme courage and agility and it was all caught on camera.
For President Macron, eager to promote his vision of France as a nation of heroes, this was enough. The act was indeed exceptional and the beneficiary was not just the boy, it was La France. Mr Gassama had qualified.