Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
ericjmorey@programming.dev to Learn Programming@programming.dev · 2 years ago

Single and Double Underscores in Python Names – Real Python

realpython.com

external-link
message-square
0
fedilink
  • cross-posted to:
  • python@programming.dev
  • python@sh.itjust.works
10
external-link

Single and Double Underscores in Python Names – Real Python

realpython.com

ericjmorey@programming.dev to Learn Programming@programming.dev · 2 years ago
message-square
0
fedilink
  • cross-posted to:
  • python@programming.dev
  • python@sh.itjust.works
In this tutorial, you'll learn a few Python naming conventions involving single and double underscores (_). You'll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.
alert-triangle
You must log in or # to comment.

Learn Programming@programming.dev

learn_programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !learn_programming@programming.dev

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.

  2. Provide everything up front. Don’t make people fish for more details in the comments. Provide background information and examples.

  3. Be present for follow up questions. Don’t ask for help and run away. Stick around to answer questions and provide more details.

  4. Ask about the problem you’re trying to solve. Don’t focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 4 users / day
  • 1 user / week
  • 10 users / month
  • 210 users / 6 months
  • 15 local subscribers
  • 1.93K subscribers
  • 122 Posts
  • 556 Comments
  • Modlog
  • mods:
  • Ategon@programming.dev
  • JaumeI@programming.dev
  • bugsmith@programming.dev
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org