Python Forum
Which method name would you choose?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which method name would you choose?
#1
I currently have this syntax
preamble, content = mediator.read()
Here, mediator is an instance of a Mediator class, which you can view as a smart pointer referencing a resource stored somewhere. The read() method accesses the resource and gets two things: a 'preamble' (instance of a Preamble class) and a 'content' which is a unicode string.

Problem: the method name read() doesn't seem very good to me because one usually expects that a read() method returns a string, but here it returns a tuple with two elements.

English is not my mother tongue, so what better word would you choose to name this method? The idea is to dereference the 'smart pointer' to get the pointed data.
« We can solve any problem by introducing an extra level of indirection »
Reply


Messages In This Thread
Which method name would you choose? - by Gribouillis - May-28-2024, 09:01 PM
RE: Which method name would you choose? - by PyDan - May-29-2024, 04:57 AM
RE: Which method name would you choose? - by PyDan - May-30-2024, 01:29 AM
RE: Which method name would you choose? - by buran - May-30-2024, 07:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  which Python choose bernd22 1 964 Sep-13-2024, 12:50 PM
Last Post: buran
  Mac os choose file name howard687 1 2,635 Jan-05-2022, 06:54 AM
Last Post: Larz60+
  Loop with choose Irv1n 5 4,554 Sep-16-2021, 09:31 PM
Last Post: deanhystad
  Choose an element from multidimensional array quest_ 2 3,676 Nov-25-2020, 12:59 AM
Last Post: quest_
  Choose your own adventure game noahc2004 2 3,559 Jun-26-2020, 02:06 PM
Last Post: DPaul
  Please help a newbie choose which programming language to learn. yeto 2 4,438 Feb-25-2019, 12:56 AM
Last Post: yeto
  User Input to Choose from Dictionary anelliaf 9 29,651 Mar-27-2018, 02:22 PM
Last Post: anelliaf
  Reasons to choose Python over C++? RandoomDude 62 59,688 May-03-2017, 05:29 PM
Last Post: micseydel
  Need a little more help in a Choose Your Own Adventure Program Goldberg291 13 25,533 Jan-31-2017, 08:33 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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