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

Single and Double Underscores in Python Names – Real Python

realpython.com

external-link
message-square
0
link
fedilink
  • cross-posted to:
  • python
  • [email protected]
8
external-link

Single and Double Underscores in Python Names – Real Python

realpython.com

ericjmorey to Learn Programming · 2 years ago
message-square
0
link
fedilink
  • cross-posted to:
  • python
  • [email protected]
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 register to comment.

Learn Programming

learn_programming

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: [email protected]

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.

  • 7 users / day
  • 16 users / week
  • 25 users / month
  • 231 users / 6 months
  • 566 local subscribers
  • 1.95K subscribers
  • 113 Posts
  • 561 Comments
  • Modlog
  • mods:
  • Ategon
  • JaumeI
  • bugsmith
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org