Title: Race condition in slider value validation · Issue #6814 · ipython/ipython · GitHub
Open Graph Title: Race condition in slider value validation · Issue #6814 · ipython/ipython
X Title: Race condition in slider value validation · Issue #6814 · ipython/ipython
Description: from IPython.html.widgets import * from IPython.display import display a = IntSlider(description='Test') display(a) a.min = 20 a.value = 50 print a.value ## displays 20 instead of 50. Although the slider visually is at 50 What is happeni...
Open Graph Description: from IPython.html.widgets import * from IPython.display import display a = IntSlider(description='Test') display(a) a.min = 20 a.value = 50 print a.value ## displays 20 instead of 50. Although the ...
X Description: from IPython.html.widgets import * from IPython.display import display a = IntSlider(description='Test') display(a) a.min = 20 a.value = 50 print a.value ## displays 20 instead of 50. Altho...
Opengraph URL: https://github.com/ipython/ipython/issues/6814
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Race condition in slider value validation","articleBody":"``` python\nfrom IPython.html.widgets import *\nfrom IPython.display import display\na = IntSlider(description='Test')\ndisplay(a)\n```\n\n``` python\na.min = 20\na.value = 50\n```\n\n``` python\nprint a.value\n## displays 20 instead of 50. Although the slider visually is at 50\n```\n\nWhat is happening is, the value is set from the Javascript side on change of min. This is happening not necessarily before the value is set on the python side in the next statement. \n\nI was able to avoid the issue by setting the value on the min_changed function on the python side and not updating it from JS.\n\n``` python\n def _handle_min_changed(self, name, old, new):\n \"\"\"Make sure the max is always \u003e= the min and change value if needed.\"\"\"\n if new \u003e self.max:\n raise ValueError(\"setting min \u003e max\")\n if self.value \u003c self.min:\n self.value = self.min\n```\n\nWhat do you guys think will be the best way to deal with this?\n\nThanks,\nSrinivas\n","author":{"url":"https://github.com/ssunkara1","@type":"Person","name":"ssunkara1"},"datePublished":"2014-10-30T15:01:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/6814/ipython/issues/6814"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e087ba9c-f7f3-9119-7b79-e3584590b411 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85E4:DD525:E0BDF0:13029CC:6A5948B3 |
| html-safe-nonce | e642ef63c28b8a343b28f7171119b226fe3da0874d5c365771913ace6cf960e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUU0OkRENTI1OkUwQkRGMDoxMzAyOUNDOjZBNTk0OEIzIiwidmlzaXRvcl9pZCI6IjMzNTU4MjQ2NTM4ODc5MTk4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 05356b3a0870ad866414bca6f51e1a6a97dbe04b43a944e1a5b1e3d1a2901518 |
| hovercard-subject-tag | issue:47280376 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ipython/ipython/6814/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f526c4956af0267d62bd358a7d4fdf5359fb242264f90ecb91aa53523e21d87a/ipython/ipython/issues/6814 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f526c4956af0267d62bd358a7d4fdf5359fb242264f90ecb91aa53523e21d87a/ipython/ipython/issues/6814 |
| og:image:alt | from IPython.html.widgets import * from IPython.display import display a = IntSlider(description='Test') display(a) a.min = 20 a.value = 50 print a.value ## displays 20 instead of 50. Although the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ssunkara1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f801e05b35c85b2d72eae6534d2b1d4c02ba8732fd046450bab31e2f52450ce |
| turbo-cache-control | no-preview |
| go-import | github.com/ipython/ipython git https://github.com/ipython/ipython.git |
| octolytics-dimension-user_id | 230453 |
| octolytics-dimension-user_login | ipython |
| octolytics-dimension-repository_id | 658518 |
| octolytics-dimension-repository_nwo | ipython/ipython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 658518 |
| octolytics-dimension-repository_network_root_nwo | ipython/ipython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 49918fc503387d6d65b6bc6ce6f711c14d17bfbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width