On 2/25/22 12:16, Дилян Палаузов wrote:
Hello,

I am trying to understand the source code.  My reading is, that
interfaces/subscriptions.py:class ISubscriptionManager.register always
returns a 3-tuple and the last element of the tuple is a member object,
or None.   This coincides with the implementation in
app/subscriptions.py.SubscriptionManager.register .
cli_synmembers.py:add_members() contains:

     member = registrar.register(
         subscriber,
         pre_verified=True,
         pre_approved=True,
         pre_confirmed=True,
         send_welcome_message=welcome_msg)[2]
     member.preferences.delivery_status = delivery_status
     member.preferences.delivery_mode = delivery_mode
     return

and commands/cli_addmembers.py:add_members() contains

     member = registrar.register(
         subscriber,
         pre_verified=True,
         pre_approved=True,
         pre_confirmed=True,
         invitation=invite,
         send_welcome_message=welcome_msg)[2]
     if member is not None:
         member.preferences.delivery_status = delivery_status
         member.preferences.delivery_mode = delivery_mode
     return

So my question is: when regirstar.register returns a tuple, the last
argument of which is a members, why do the above snippets store the
result in a variable called `member`?


The above snippets say  member = registrar.register(...)[2]

I.e. member is set to the last element of the 3-tuple.


--
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9

Reply via email to