Title: Question Regarding Global Statements · Issue #154 · quantifiedcode/python-anti-patterns · GitHub
Open Graph Title: Question Regarding Global Statements · Issue #154 · quantifiedcode/python-anti-patterns
X Title: Question Regarding Global Statements · Issue #154 · quantifiedcode/python-anti-patterns
Description: Hello! I wanted to read more on the references on this page https://docs.quantifiedcode.com/python-anti-patterns/maintainability/using_the_global_statement.html I know the book entails things you should "NEVER" do in practice. So I ask t...
Open Graph Description: Hello! I wanted to read more on the references on this page https://docs.quantifiedcode.com/python-anti-patterns/maintainability/using_the_global_statement.html I know the book entails things you s...
X Description: Hello! I wanted to read more on the references on this page https://docs.quantifiedcode.com/python-anti-patterns/maintainability/using_the_global_statement.html I know the book entails things you s...
Opengraph URL: https://github.com/quantifiedcode/python-anti-patterns/issues/154
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question Regarding Global Statements","articleBody":"Hello! \r\n\r\nI wanted to read more on the references on this page https://docs.quantifiedcode.com/python-anti-patterns/maintainability/using_the_global_statement.html\r\n\r\nI know the book entails things you should \"NEVER\" do in practice. So I ask this in the context of putting things in the global scope.\r\n\r\nDo we consider instantiating built in modules like logger anti patterns? Or should this be something that should be encapsulated in its own class.\r\n\r\n```\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\nlogger = logging.getLogger(__name__)\r\n```\r\n\r\nOr perhaps this was meant to deter a developer from using the `global` statement. \r\n\r\nThe logging function is something I want to instantiate on any files that logs and it seems safe if I define it everywhere. \r\n```The logging module is intended to be thread-safe without any special work needing to be done by its clients. It achieves this though using threading locks; there is one lock to serialize access to the module’s shared data, and each handler also creates a lock to serialize access to its underlying I/O.```\r\nhttps://docs.python.org/3/library/logging.html#thread-safety","author":{"url":"https://github.com/Keydex","@type":"Person","name":"Keydex"},"datePublished":"2021-02-07T14:42:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/154/python-anti-patterns/issues/154"}
| 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:679ae81d-742a-5479-6a62-e3fcbabdf702 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A94:3C73C0:83C51:B4D18:696A6A90 |
| html-safe-nonce | c1c028b51149741f0d340e6150df1e7b609e614b61a753ac9670175ffe269471 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTk0OjNDNzNDMDo4M0M1MTpCNEQxODo2OTZBNkE5MCIsInZpc2l0b3JfaWQiOiI4OTk5NDE3MDYzNTMyMDMwNjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7a1969fd71ef9456af48471d2dda08121b14c8fd52d608a6f7a9e333abf6e14e |
| hovercard-subject-tag | issue:802968104 |
| 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/quantifiedcode/python-anti-patterns/154/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ab3358d685ab052b18ad3962ae0e8c4be91e03e9f3a32d425502f29005f4ee1/quantifiedcode/python-anti-patterns/issues/154 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ab3358d685ab052b18ad3962ae0e8c4be91e03e9f3a32d425502f29005f4ee1/quantifiedcode/python-anti-patterns/issues/154 |
| og:image:alt | Hello! I wanted to read more on the references on this page https://docs.quantifiedcode.com/python-anti-patterns/maintainability/using_the_global_statement.html I know the book entails things you s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Keydex |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6 |
| turbo-cache-control | no-preview |
| go-import | github.com/quantifiedcode/python-anti-patterns git https://github.com/quantifiedcode/python-anti-patterns.git |
| octolytics-dimension-user_id | 6774260 |
| octolytics-dimension-user_login | quantifiedcode |
| octolytics-dimension-repository_id | 22258112 |
| octolytics-dimension-repository_nwo | quantifiedcode/python-anti-patterns |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22258112 |
| octolytics-dimension-repository_network_root_nwo | quantifiedcode/python-anti-patterns |
| 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 | f2d9f6432a5a115ec709295ae70623f33bb80aee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width