Python Forum
seeking names for my functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
seeking names for my functions
#1
i am completely refactoring a function i wrote a year or two ago that runs a POSIX command pipeline (commands chained with STDOUT from a command feeding STDIN of the next command). this time i am making three variations, #1 is a generator that yields one line at a time, #2 returns a list of lines for the whole output (after it waits for EOF), #3 just returns the read end of the pipe from STDOUT of the last process. the generator has an option to yield an extra value at the start and another value at the end of the generated sequence of yields. the string type for the lines can be specified like type=str or type=bytes. and type checking is more thorough.

normally a command pipeline is given as a sequence of commands. a command is given as a sequence of strings. but if the 2nd level is all strings giving just one command (not a pipeline) it is wrapped in a tuple to be a "pipeline" of just one command. a single command (a sequence of strings) can be given either way.

any string can by given as type str, or bytes, or bytearray. any sequence can be given as type list or type tuple.

keyword argument stdin= is passed to the first command to give it input. this can be an open file object, or an int, or a string. if it is an int or string, it is opened to be a file object. if stdin=False then the null file is opened. i am thinking about ways to do stdout= which may conflict with the three output variations. that may include a stderr= keyword argument.

what i am seeking is suggestions for names for these functions. i initially coded them with big long names (such as command_pipeline_generator()). are big long names preferred, or shorter names? or maybe extreme short.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  good names for these functions Skaperen 0 1,271 Dec-30-2019, 02:24 AM
Last Post: Skaperen
  SEEKING BETA TESTERS W/ PYTHON EXPERIENCE ltarshis 0 1,673 Feb-19-2019, 06:24 PM
Last Post: ltarshis
  Seeking Advice: Multiple workstations for one project mfayler 6 6,958 Oct-18-2016, 08:25 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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