Apologies in advance, this is something that I really figured I could find on the web, but I was having troubles.
In Python, in the header portion, I see that sometimes people will wrap their literals with a dollar sign ( $ ). It seems, judging from examples, that this is a pointer to fill in information that is automatically updated (maybe via source control?), but I do not understand how it works.
For instance:
__version__ = '$Revision: 4799 $'.split()[1]
__date__ = '$Date: 2006-09-25 11:09:02 -0400 (Mon, 25 Sep 2006) $'.split()[1]
__author__ = 'John Doe FIX: put in the authors name'
is an example that I found at ( Python Example Documentation Template ). So the $ is wrapped around the version (which will alter over time), and the date (which will also alter). Assuming it is some sort of pointer to always capture up-to-date information regarding the version, date, etc., can someone point me to how this works? Which source control software use this syntax? Is it the same across languages?
Thank you!
That dollar sign means: we're in the system shell, i.e the program that you're put into as soon as you open the Terminal app. The dollar sign is often the symbol used to signify where you can begin typing in commands (you should see a blinking cursor there).
In markdown editors such as GitHub , or Jupyter notebook , with MathJax available, you can use double backslash and a dollar sign together to show any amount or range of amount in the dollar. Note that, in StackExchange or any StackOverflow related site, a single backslash is enough.
This isn't specific to Python, it's something used by source control systems, going back to RCS and CVS.
See CVS Keywords for a list of the CVS syntax. While few people use CVS nowadays, many of the source control systems people do use (most notably, subversion) handle CVS syntax or a slight variation of it. (And some people also create build scripts that do similar substitutions at build time rather than checkin time.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With