Title: Trait default values are validated even when not ever used · Issue #7769 · ipython/ipython · GitHub
Open Graph Title: Trait default values are validated even when not ever used · Issue #7769 · ipython/ipython
X Title: Trait default values are validated even when not ever used · Issue #7769 · ipython/ipython
Description: from IPython.utils.traitlets import * class Foo(HasTraits): bar = Type(allow_none=False) foo = Foo(bar=int) yields The 'bar' trait of a Foo instance must be a subclass of object, but a value of type 'NoneType' (i.e. None) was specified. ...
Open Graph Description: from IPython.utils.traitlets import * class Foo(HasTraits): bar = Type(allow_none=False) foo = Foo(bar=int) yields The 'bar' trait of a Foo instance must be a subclass of object, but a value of typ...
X Description: from IPython.utils.traitlets import * class Foo(HasTraits): bar = Type(allow_none=False) foo = Foo(bar=int) yields The 'bar' trait of a Foo instance must be a subclass of object, but a valu...
Opengraph URL: https://github.com/ipython/ipython/issues/7769
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Trait default values are validated even when not ever used","articleBody":"``` Python\nfrom IPython.utils.traitlets import *\n\nclass Foo(HasTraits):\n bar = Type(allow_none=False)\n\nfoo = Foo(bar=int)\n```\n\nyields `The 'bar' trait of a Foo instance must be a subclass of object, but a value of type 'NoneType' (i.e. None) was specified.`\n\nThe default value is validated while it is not needed. \n","author":{"url":"https://github.com/SylvainCorlay","@type":"Person","name":"SylvainCorlay"},"datePublished":"2015-02-13T00:27:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/7769/ipython/issues/7769"}
| 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:94d0b5c4-bef4-f4f6-863b-10ecd0f110d0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF94:1F7BBA:72AAF3:9CCC14:6A59263A |
| html-safe-nonce | 76720c091d68141331b470fd392a61bf9b6678eaf76a8c7e68bb70ed778fe7a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjk0OjFGN0JCQTo3MkFBRjM6OUNDQzE0OjZBNTkyNjNBIiwidmlzaXRvcl9pZCI6IjM0NjEwODY2NjI2ODc3OTQ3NDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c27197e2777eb5260232ff5033bb2cb650a515b225dfe1773d9f782a21a16762 |
| hovercard-subject-tag | issue:57541894 |
| 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/7769/issue_layout |
| twitter:image | https://opengraph.githubassets.com/73e1eba3f819f9b3ef8f8b80cc76a1b51b29a0372fe1acfd8a79b880fd0e5a17/ipython/ipython/issues/7769 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/73e1eba3f819f9b3ef8f8b80cc76a1b51b29a0372fe1acfd8a79b880fd0e5a17/ipython/ipython/issues/7769 |
| og:image:alt | from IPython.utils.traitlets import * class Foo(HasTraits): bar = Type(allow_none=False) foo = Foo(bar=int) yields The 'bar' trait of a Foo instance must be a subclass of object, but a value of typ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SylvainCorlay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 30abb2b48d3b1b476bbaf01f49ead8ef91062bfd762d3fa28a956f4c99653343 |
| 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 | f2e5b4fd472ea10ac216e358bbd0821a90dae8bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width