Python Forum
Improving my understanding of functions and methods
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Improving my understanding of functions and methods
#1
I'm taking some advice from one of the tips here and using pylint and pylint3.
I'm using it on the code I posted in the review. I got the original code only throwing to warnings about(too many instances) which I am working on now.
On some of the code for my methods says could be a function. If I put self in front it, it goes away. Using the code I posted, it should be safe to day for the header image and the footer I could choose to put those as functions in the top of my program. They never change. For data manipulation those should be methods. Example I can use methods to pull the titles out and display. The same for the information that the titles display when clicked.

Just need input best practices most used. A lot of code I've seen seems to be what the author favors.

On a side note, I've noticed pylint/pylint3 throws warnings if too many methods are in a class. Is this also a preference? Whether it be one or 100? I know a class creates an object and methods describe what the object look like so to speak. Say the class creates person and the methods give that person brown hair, height, build, and so forth. Well anyway any input would be great.

Thanks
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
Improving my understanding of functions and methods - by menator01 - Apr-24-2020, 05:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  functions/methods menator01 2 1,660 Oct-02-2021, 07:37 PM
Last Post: menator01
  Need help improving function that reads file into list of tuples t4keheart 6 3,113 Nov-03-2020, 04:58 AM
Last Post: ndc85430
  Improving code to autorename if filename exists Den0st 5 3,028 Sep-23-2019, 07:53 AM
Last Post: wavic
  Need help understanding a couple of functions (encrypt,decrypt, int_to_bytes) xoani 0 2,020 Jun-09-2019, 03:25 PM
Last Post: xoani
  Improving bot SheeppOSU 0 27,311 Jun-01-2019, 08:06 PM
Last Post: SheeppOSU
  How to find functions or methods in a module? deepakdeshp 8 4,353 May-23-2019, 09:36 AM
Last Post: DeaD_EyE
  Is there a way of improving this leaderboard system? Zelpha 2 3,912 Feb-11-2019, 06:32 PM
Last Post: ichabod801
  i have problems understanding 2 functions,look for help. Tony 2 2,664 Dec-05-2018, 12:35 PM
Last Post: Tony
  Help in understanding scope of dictionaries and lists passed to recursive functions barles 2 3,256 Aug-11-2018, 06:45 PM
Last Post: barles
  Improving Efficiency of SVM by various available kernels Sachtech 0 2,123 Apr-09-2018, 07:29 AM
Last Post: Sachtech

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020