Title: Functions notes · Issue #2 · stanfordpython/course-reader · GitHub
Open Graph Title: Functions notes · Issue #2 · stanfordpython/course-reader
X Title: Functions notes · Issue #2 · stanfordpython/course-reader
Description: Namespaces are new (I know they're marked as "revisited" in the notes, but they never appear before – alternatively, we can add them to Python basics? Builtins: you shouldn't be naming variables that overwrite Python's builtins (abs, len...
Open Graph Description: Namespaces are new (I know they're marked as "revisited" in the notes, but they never appear before – alternatively, we can add them to Python basics? Builtins: you shouldn't be naming variables th...
X Description: Namespaces are new (I know they're marked as "revisited" in the notes, but they never appear before – alternatively, we can add them to Python basics? Builtins: you shouldn't be n...
Opengraph URL: https://github.com/stanfordpython/course-reader/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Functions notes","articleBody":"\u003cul\u003e\r\n\u003cli\u003eNamespaces are new (I know they're marked as \"revisited\" in the notes, but they never appear before – alternatively, we can add them to Python basics?\u003c/li\u003e\r\n\u003cli\u003e\r\n\r\n\u003e Builtins: you shouldn't be naming variables that overwrite Python's builtins (abs, len, list - a full list is available here) in the first place, but in the event that you are, Python will check here anyways. 🙃\r\n\r\nEither this is incorrect or I'm getting confused by it. Consider, for example:\r\n\r\n```python\r\nsum = 3\r\nsum(1, 2, 3) # TypeError: 'int' object is not callable\r\n```\r\n\r\nIn this code, Python will use `3` in place of the builtin `sum` when `sum` is referenced. That means Python a) doesn't \"check here [the builtins] anyways\" because it stops once it finds `sum` in the global table, b) it's a little misleading to say that we're \"overwriting\" the builtin even though we talk that way – you can still access it with `__builtins__.sum`.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\r\n\u003e When calling a function, Python enforces that positional arguments must appear in the function call before keyword arguments.\r\n\r\nMight want to mention why?\r\n\u003c/li\u003e\r\n\u003cli\u003eThis is kinda painful, but it's not precise to describe the first/second line(s) of execution like you do.\u003c/li\u003e\r\n\u003cli\u003eYou never mentioned that \"if this is confusing, you can treat mutable objects like pass-by-reference and immutable objects like pass-by-value.\"\u003c/li\u003e\r\n\u003cli\u003eCan we rename `euclidean_dist`? I think some students might not know what that means.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\r\nI didn't look over everything, but these are my initial thoughts!","author":{"url":"https://github.com/parthsarin","@type":"Person","name":"parthsarin"},"datePublished":"2020-08-22T04:10:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2/course-reader/issues/2"}
| 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:b209530c-05b9-cb23-fdc3-2bb4f610be4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A244:162028:646D453:82A4AA0:697E3819 |
| html-safe-nonce | 30b7dc3ba517c56115b47d81ec9045a6605885b7af221591b5ab006aa8d75739 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjQ0OjE2MjAyODo2NDZENDUzOjgyQTRBQTA6Njk3RTM4MTkiLCJ2aXNpdG9yX2lkIjoiNjU3NzkwNTEwNDY2MDA4NDc2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 568560d7dc1b65a96a16a4a81eae8fec2522c96b987d5879d5b8e200d172fa49 |
| hovercard-subject-tag | issue:683923060 |
| 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/stanfordpython/course-reader/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/541bf679c221e33e259fccb69ff4379eebc713644ec442d934b0606d06c3928a/stanfordpython/course-reader/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/541bf679c221e33e259fccb69ff4379eebc713644ec442d934b0606d06c3928a/stanfordpython/course-reader/issues/2 |
| og:image:alt | Namespaces are new (I know they're marked as "revisited" in the notes, but they never appear before – alternatively, we can add them to Python basics? Builtins: you shouldn't be naming variables th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | parthsarin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/stanfordpython/course-reader git https://github.com/stanfordpython/course-reader.git |
| octolytics-dimension-user_id | 13142353 |
| octolytics-dimension-user_login | stanfordpython |
| octolytics-dimension-repository_id | 284186205 |
| octolytics-dimension-repository_nwo | stanfordpython/course-reader |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 284186205 |
| octolytics-dimension-repository_network_root_nwo | stanfordpython/course-reader |
| 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 | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width