Python Forum
Passing writable arguments to functions.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing writable arguments to functions.
#11
(Jan-15-2024, 05:38 PM)sgrey Wrote: pass by assignment, which is not even fully correct, but I guess does highlight the concept in way.
I think "pass by assignment" is ambiguous because assignment means different things in different languages. "Pass by Python assignment" would be better. In C++ classes can redefine the assignment operator, but the assignment operator is used when objects are passed by value as far as I remember.

I would probably use "pass by object", like in "please pass the bread".
« We can solve any problem by introducing an extra level of indirection »
Reply
#12
(Jan-15-2024, 08:04 PM)Gribouillis Wrote:
(Jan-15-2024, 05:38 PM)sgrey Wrote: pass by assignment, which is not even fully correct, but I guess does highlight the concept in way.
I think "pass by assignment" is ambiguous because assignment means different things in different languages. "Pass by Python assignment" would be better. In C++ classes can redefine the assignment operator, but the assignment operator is used when objects are passed by value as far as I remember.

I would probably use "pass by object", like in "please pass the bread".

Well, to be fair they do mean it as a python assignment since every language do have different assignment semantics (especially Rust). Pass by object is also a little ambiguous in my opinion.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 424 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Passing string functions as arguments Clunk_Head 3 1,268 Jun-15-2022, 06:00 AM
Last Post: Gribouillis
  Why Pass Functions as arguments? muzikman 14 5,701 Jan-18-2021, 12:08 PM
Last Post: Serafim
  redirect url_for passing arguments with the url Leon79 1 1,658 Jul-09-2020, 05:20 PM
Last Post: Leon79
  passing-arguments-from-one-script-to-another jacklee26 7 3,266 Apr-21-2020, 03:55 PM
Last Post: deanhystad
  Python 2.7 passing variables from functions zetto33 1 1,794 Mar-19-2020, 07:27 PM
Last Post: Larz60+
  Still confused about how passing arguments works RedSkeleton007 3 2,984 Apr-25-2018, 11:01 AM
Last Post: snippsat
  Trouble passing arguments underoathed 2 2,947 Nov-13-2017, 04:20 PM
Last Post: underoathed
  AttributeError: attribute 'port' of 'liblo._ServerBase' objects is not writable emrebt39 2 3,452 Jun-17-2017, 08:04 PM
Last Post: emrebt39
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 3,886 Mar-02-2017, 10:23 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

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