-
-
Save ChrisBeaumont/5758381 to your computer and use it in GitHub Desktop.
| <style> | |
| @font-face { | |
| font-family: "Computer Modern"; | |
| src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf'); | |
| } | |
| div.cell{ | |
| width:800px; | |
| margin-left:16% !important; | |
| margin-right:auto; | |
| } | |
| h1 { | |
| font-family: Helvetica, serif; | |
| } | |
| h4{ | |
| margin-top:12px; | |
| margin-bottom: 3px; | |
| } | |
| div.text_cell_render{ | |
| font-family: Computer Modern, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; | |
| line-height: 145%; | |
| font-size: 130%; | |
| width:800px; | |
| margin-left:auto; | |
| margin-right:auto; | |
| } | |
| div.text_cell_render li { | |
| line-height: 145%; | |
| } | |
| div.text_cell_render code { | |
| color: rgb(40, 114, 43); | |
| font-family: "Source Code Pro", source-code-pro,Consolas, monospace; | |
| font-size: 80%; | |
| } | |
| .CodeMirror{ | |
| font-family: "Source Code Pro", source-code-pro,Consolas, monospace; | |
| } | |
| .prompt{ | |
| display: None; | |
| } | |
| .text_cell_render h5 { | |
| font-weight: 300; | |
| font-size: 16pt; | |
| color: #4057A1; | |
| font-style: italic; | |
| margin-bottom: .5em; | |
| margin-top: 0.5em; | |
| display: block; | |
| } | |
| .warning{ | |
| color: rgb( 240, 20, 20 ) | |
| } | |
| </style> | |
| <script> | |
| MathJax.Hub.Config({ | |
| TeX: { | |
| extensions: ["AMSmath.js"] | |
| }, | |
| tex2jax: { | |
| inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
| displayMath: [ ['$$','$$'], ["\\[","\\]"] ] | |
| }, | |
| displayAlign: 'center', // Change this to 'center' to center equations. | |
| "HTML-CSS": { | |
| styles: {'.MathJax_Display': {"margin": 4}} | |
| } | |
| }); | |
| </script> |
First of all, thanks for the great article, it's informative and easy to follow! I wanted to let you know the link posted under the "UPDATE" is actually dead at this point.
Also, I can't immediately see a "natural" way to combine multiple descriptors to enforce multiple constraints (say negative and even).. am I missing something? I'm asking purely out of curiosity.
@ChrisBeaumont i observed a typo in the following code fragment. "-1" value needs to be changed to "-100"
m = Movie('Casablanca', 97, 102, 964000, 1300000) print m.budget # calls Movie.budget.__get__(m, Movie) m.rating = 100 # calls Movie.budget.__set__(m, 100) try: m.rating = -1 # calls Movie.budget.__set__(m, -100) except ValueError: print "Woops, negative value"
@ChrisBeaumont, @jaimefrio The link seems to be wrong again. ;-). I think the correct link is: https://mail.python.org/pipermail/python-list/2012-January/618572.html
Good point -- I've made the fix. Thanks!