Channel Avatar

PyMastery Community @UCsNoJ36If184TKXYGaY5s3g@youtube.com

213 subscribers - no pronouns :c

More from this channel (soon)


Welcoem to posts!!

in the future - u will be able to do some more stuff here,,,!! like pat catgirl- i mean um yeah... for now u can only see others's posts :c

PyMastery Community
Posted 1 year ago

What is the relation between the Lookup Chain and MRO in Python?

Question:
In Python, I've come across two concepts, the Lookup Chain and the Method Resolution Order (MRO), which seem related but I'm having trouble understanding their relationship. Could someone please clarify the connection between these two concepts?

Explanation:
From my understanding, the lookup chain refers to the order in which Python searches for attributes and methods in a class hierarchy. It determines the sequence of classes to be traversed during attribute and method resolution. On the other hand, the MRO is a specific algorithm used by Python to determine the order in which methods are resolved in a class hierarchy, especially in cases of multiple inheritance.

I'm seeking a clearer explanation of are these two concepts are connected. Does the lookup chain play a role in the MRO algorithm? How does the MRO ensure the correct method resolution in complex inheritance scenarios?

#python #inheritance #mro #oops

0 - 0

PyMastery Community
Posted 1 year ago

Hi everyone πŸ‘‹,

I'm creating a community post about the Method Resolution Order (MRO) algorithm in the Python inheritance hierarchy πŸ—ΊοΈ.

MRO is a concept used in inheritance. It is the order in which a method is searched for in a class's hierarchy 🏒 and is especially useful in Python because Python supports multiple inheritance 🀯.

Can anyone explain how the MRO algorithm works? What algorith it uses internally? What are the benefits of using MRO? What are some of the limitations of MRO?

I'd love to hear your thoughts in the comments below πŸ‘‡.

Thanks! πŸ™

5 - 1

PyMastery Community
Posted 1 year ago

πŸ” QUIZ TIME! Test Your Python Knowledge! πŸ”

Hey there, Python enthusiasts! Let's put your skills to the test with a little code challenge. 🐍πŸ’ͺ
Consider the following Python statement:

dict({'F': 1, 'S': 2, 'M': 3, 'N': 4} for _ in range(2))

Can you guess what the output of this statement will be? πŸ€”
Cast your vote in the poll below with your best prediction! ⬇️

πŸ”΅ Option 1: `{'F': 1, 'S': 2, 'M': 3, 'N': 4}`
πŸ”΅ Option 2: `{'F': 'S', 'M': 'N'}`
πŸ”΅ Option 3: `ValueError`

Vote now and let's find out the correct answer together! πŸŽ‰
Feel free to share your reasoning in the comments section. And don't forget to subscribe to my channel for more exciting Python content. Happy coding! πŸ˜„πŸ

#Python

5 - 1

PyMastery Community
Posted 1 year ago

Sharing Global Variables Across Modules - Seeking Your Insights!

Hey, amazing community! πŸ‘‹

Today, I have an intriguing question for all you Python enthusiasts out there. I'm sure many of you have encountered situations where you needed to share global variables across different modules. It's an interesting topic, and I'm curious to know your thoughts and insights on this matter.

πŸ€” So, here's my question for you: How do you effectively share global variables across modules in Python?

Whether you have personal experiences, best practices, or unique approaches, I'd love to hear from you! Sharing your knowledge and expertise will not only benefit me but also help the entire community gain a deeper understanding of this topic.

Feel free to leave your valuable insights, tips, or even code snippets in the comments section below. Let's engage in a constructive discussion and learn from each other's experiences.

πŸŽ₯ Remember, your contributions can be featured in an upcoming video, so don't forget to mention your name/handle. Your participation is greatly appreciated!

Thank you in advance for taking the time to share your expertise. I look forward to reading your responses and learning from the vibrant community we have here.

Stay curious and keep coding! πŸ’»βœ¨

#Python

3 - 0

PyMastery Community
Posted 1 year ago

πŸ“’ RELATIVE PATH NOTATIONS

Hey there, Linux enthusiasts! 🐧

Let's dive into the fascinating world of relative path notations. πŸ—ΊοΈβœ¨

πŸ”₯ POLL TIME! πŸ”₯

Which relative path notation do you use the most? Vote now and let's see which notation reigns supreme! πŸ“ŠπŸ€”

πŸ‘ Vote for `../` to represent the parent directory.
❀️ Vote for `./` to represent the current directory.
πŸ˜„ Vote for `~/` to refer to the user's home directory.
πŸ” Vote for `../../` to navigate two levels up the directory hierarchy.

Ready to cast your vote? Let's hear your choice! ⬇️

And while you're at it, don't miss our latest YouTube short on relative path notations! πŸŽ₯πŸ”—
Watch Here πŸŽ₯ : youtube.com/shorts/oa-4rA7jMu...

Stay tuned for our upcoming video, where we'll explore the power of relative path notations in Linux. Don't forget to like, share, and subscribe for more exciting Linux content! πŸŽ‰

#Linux #RelativePaths #VoteNow #CommunityPoll #linuxcommands #linuxcommandline #linuxterminal #relativepathnotations#linux_tutorial

../ command linux

4 - 0

PyMastery Community
Posted 1 year ago

Linux enthusiasts, it's time for a question! πŸ§πŸ’»

On a Linux system, which directory do you think contains applications and files used by users? πŸ“‚πŸ‘₯

Let's test your Linux knowledge! Cast your vote!

4 - 1