Python Forum
Is it bad practice to return a variable and not use it?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it bad practice to return a variable and not use it?
#5
If the place the function is called from is saving the files you don't want saved, I would add a parameter to that place: save = True. Then have a conditional based on that parameter, and put the saving code in that conditional. That should not change the behavior of your code normally. However, when you loop to refresh the Table widget, you call that place with save = False, preventing duplication of the data.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Is it bad practice to return a variable and not use it? - by ichabod801 - Mar-23-2017, 10:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  best practice example data science mostafa705 1 882 Oct-13-2023, 04:44 AM
Last Post: KianLynch
  Practice coding through hackathon!! TheOutcast 0 1,553 Jun-11-2020, 12:03 PM
Last Post: TheOutcast
  Coding Practice BarakTu 2 3,360 Apr-14-2018, 05:31 AM
Last Post: buran
  is it considered good practice to ... Skaperen 9 6,349 May-10-2017, 02:42 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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