Skip to content

Conversation

@beverand
Copy link
Contributor

@beverand beverand commented Sep 16, 2022

Description

Closes #586

Type of Change

  • Adding a new entry
  • Editing an existing entry (fixing a typo, bug, issues, etc)

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).

@CLAassistant
Copy link

CLAassistant commented Sep 16, 2022

CLA assistant check
All committers have signed the CLA.

@beverand
Copy link
Contributor Author

Added the super() term as discussed in issue #586

  • created super.md under python/concepts/built-in-functions/terms/super
  • removed super() from python inheritance entry

@Dusch4593 Dusch4593 linked an issue Sep 16, 2022 that may be closed by this pull request
3 tasks
@Dusch4593 Dusch4593 changed the title add definition for python super() [New Entry/ Edits] Python Builtin-Functions: super()/ Sep 16, 2022
@Dusch4593 Dusch4593 changed the title [New Entry/ Edits] Python Builtin-Functions: super()/ [New Entry/ Edits] Python Builtin-Functions: super()/ Inheritance Sep 16, 2022
@Dusch4593 Dusch4593 added enhancement New feature or request python Python entries new entry New entry or entries labels Sep 16, 2022
@Dusch4593
Copy link
Contributor

Dusch4593 commented Sep 16, 2022

Added the super() term as discussed in issue #586

  • created super.md under python/concepts/built-in-functions/terms/super
  • removed super() from python inheritance entry

@beverand Thanks for submitting this PR! I'm looking forward to conducting the first review for this 😄

Quick tip: For your next PR, if you write "Closes #[this issue number]" (per the GitHub docs) in the "Description" near the top of the PR, the related issue will be linked to the PR. (No worries for this one, though; just edited the description 😎)

Copy link
Contributor

@Dusch4593 Dusch4593 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beverand Finished with my review and just left some comments/suggestions for you to check out. I might have more later but I wanted to give you a chance to look at what I have so far. Let me know if you have any questions. 😄

## Example
In this case, the `.say_hi()` method is implemented utilizing `super()` inside `.intro()`:

```py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```py
```codebyte/python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

@@ -0,0 +1,53 @@
---
Title: 'super()'
Description: 'implicitly refer to the superclass'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Description: 'implicitly refer to the superclass'
Description: 'Returns a temporary object that allows a given class to inherit the methods and properties of a parent or sibling class.'

Let's make sure to use capitalization and punctuation. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@beverand
Copy link
Contributor Author

beverand commented Sep 16, 2022 via email

@Dusch4593
Copy link
Contributor

Dusch4593 commented Sep 16, 2022

@beverand I would undo the changes in 4e8541e. When I suggested bolding "Inheritance" I meant the edit should happen in line # 16 in the inheritance.md file (not the super.md file). Content in the meta-information (first 13-15 lines of the file) should not be emphasized in any way.

@beverand
Copy link
Contributor Author

Thank you for your patience helping me. I admit, I'm using vi in the terminal for all of my edits.

@Dusch4593
Copy link
Contributor

Dusch4593 commented Sep 16, 2022

Thank you for your patience helping me. I admit, I'm using vi in the terminal for all of my edits.

I'm always happy to help 😄 and kudos for working with the repo through the vi editor!

@Dusch4593
Copy link
Contributor

@beverand Would you be open to trying to format the entry on your side with the following command when you get a chance?

yarn format content/python/concepts/built-in-functions/terms/super/super.md content/python/concepts/inheritance/inheritance.md

@Dusch4593
Copy link
Contributor

@beverand Would you be open to trying to format the entry on your side with the following command when you get a chance?

yarn format content/python/concepts/built-in-functions/terms/super/super.md content/python/concepts/inheritance/inheritance.md

And then add, commit, and push the changes like you normally would?

@beverand
Copy link
Contributor Author

beverand commented Sep 16, 2022 via email

@beverand
Copy link
Contributor Author

beverand commented Sep 16, 2022 via email

@Dusch4593
Copy link
Contributor

I am getting errors. Something with prettier or something with Arborist. On Fri, Sep 16, 2022 at 4:31 PM Beverly Andrews @.> wrote:

I think there are things I have to install to make that work On Fri, Sep 16, 2022 at 4:21 PM Brandon Dusch @.
> wrote: > @beverand https://github.com/beverand Would you be open to trying to > format the entry on your side with the following command when you get a > chance? > > yarn format content/python/concepts/built-in-functions/terms/super/super.md content/python/concepts/inheritance/inheritance.md > > — > Reply to this email directly, view it on GitHub > <#1008 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AEZUG6XITOB5UZ2QZW3QWLTV6T6F7ANCNFSM6AAAAAAQOCNCAQ > . > You are receiving this because you were mentioned.Message ID: > @.***> >

Any chance you could copy/paste the exact error message here?

Copy link
Contributor

@Dusch4593 Dusch4593 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @beverand! I found a few last areas for suggestions and comments on my end before we merge. After you've implemented this last batch of feedback and @KTom101 and I approve the changes, we should be good for merge. 😄

Btw, I just wanna give you kudos for the work you've put into this PR this week. This is an incredibly important and oft-used Python function that has a lot packed into it. Major props! We can't wait for your contribution to come alive when it gets merged! 🚀

super(type, object)
```

`.method()` is the accessed method of the parent class. `type` specifies the type object of the parent class and object is an instance or subtype of the `type`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`.method()` is the accessed method of the parent class. `type` specifies the type object of the parent class and object is an instance or subtype of the `type`.
The `type` specifies the object type of the parent class and `object` is an instance or subtype of the `type`.
The `super()` function is commonly applied to a single-inheritance class hierarchy:


`super()` returns a temporary object of the superclass, allowing the superclass’s methods to be called. This comes in handy when using multiple inheritance to derive a class from more than one base class.

## Codebyte Example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one Codebyte example + snippet per entry. Since both snippets produce the same output, I would suggest using one Codebyte snippet that implement both syntaxes.

Copy link
Contributor

@KTom101 KTom101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beverand Added a few more changes, mainly concerning the second codebyte. We only want one codebyte on the page and it should be at the end. I've added changes to reflect that.

beverand and others added 12 commits September 23, 2022 11:05
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
…xample"

Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: KTom101 <kyrathompson@me.com>
Co-authored-by: Brandon Dusch <brandondusch@gmail.com>
Co-authored-by: Brandon Dusch <brandondusch@gmail.com>
@beverand beverand requested review from Dusch4593 and KTom101 and removed request for Dusch4593 September 23, 2022 23:48
Copy link
Contributor

@Dusch4593 Dusch4593 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @beverand! Thank you very much for the last batch of changes 😄 I think everything looks good from my end. I applied some changes that I wanted to let you know about:

  • Added two subsections under "Syntax" that describe how both syntaxes (with and without arguments) can be applied inside and outside a class definition.
  • Changed the example section into a Codebyte.
  • Removed "## super" heading and text that originally came from the Python concept entry about inheritance.

Copy link
Contributor

@KTom101 KTom101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beverand @Dusch4593 The new changes look great! 👍

@Dusch4593 Dusch4593 merged commit fe883b6 into Codecademy:main Sep 26, 2022
@KTom101
Copy link
Contributor

KTom101 commented Sep 26, 2022

@Dusch4593
Copy link
Contributor

Thanks for posting those, @KTom101!

Hey @beverand I noticed that your Codecademy profile isn't appearing on the page for super()?

Screen Shot 2022-09-26 at 2 21 42 PM

Have you connected your Codecademy profile with your GitHub account? Happy to help with the steps so you receive credit as a contributor this content. 😄

yangc95 pushed a commit that referenced this pull request Sep 28, 2022
…1008)

* add definition for python super()

* Made set of updateds for spacing and content improvement

* Removed note

* Bold inheritance in tag list

* Revert "Bold inheritance in tag list"

This reverts commit 4e8541e.

* Bold Inheritance on line 16

* Removed extra line

* Ran npm run format on super.md and inheirtance.md

* Update content/python/concepts/inheritance/inheritance.md

* Update content/python/concepts/built-in-functions/terms/super/super.md

* Update content/python/concepts/built-in-functions/terms/super/super.md

* Additional changes from second review update links and text changes

* remove yarn.lock

* Move text from above pseudo to below it

* add yarn.lock back

* Delete yarn.lock

* added yarn.lock back (again)

* re-mirrored yarn.lock against one from main branch

* Update content/python/concepts/built-in-functions/terms/super/super.md

* Updated super(type) to super(type, object) with example

* Update reference to 'object' in pseudocode to 'obj'

* remove line at 73

* Update intro to example from "this case" to "the following codebyte example"

* remove line at 56

* Shorten reference from "object" to "obj"

* Change example intro at line 39

* Remove Codebyte from example

* Reverse change from codebyte/python back to py

* Clarify child and subclass references

* Update to note add >

* Add 'Classes' to tags

* Updates including mod to codebyte example and additional pseudo code

* some last edits
@Dusch4593 Dusch4593 added the hacktoberfest-accepted Indicates the PR was approved, merged, and pertains to Hacktoberfest label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request hacktoberfest hacktoberfest-accepted Indicates the PR was approved, merged, and pertains to Hacktoberfest new entry New entry or entries python Python entries status: review 1️⃣ completed status: review 2️⃣ completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Term Entry] Python Built-in Functions: super()

4 participants