The Library smtplib
(protocol client SMTP
)
The module smtplib
sets a client session object SMTP
which can be used to send messages to any Internet machine with a listener daemon SMTP
or ESMTP
. For details about the operation SMTP
and ESMTP
, consult RFC 821 (Simple Mail Transfer Protocol) and RFC 1869 (Service Extensions SMTP
).
class smtplib.SMTP(host='', port=0, local_hostname=None, [timeout, ]source_address=None)
Dictionary in python
Dictionary is a different kind of collection. It is a type of mapping native to the Python
. A map is a disorderly associative collection. The association, or mapping, is made from a key, which can be any immutable type, to a value, which can be any data object of the Python
.
So, knowing this we can see clearly that there is a difference between a dictionary and the library smtplib
... The library smtplib
implements only the class SMTP
(where you instance the same) and a dictionary is just a type of object, so it happens what you said in your question about the type(smtpObj)
.
NOTE
In this example of Alura you can clearly see the workings of a dictionary.
Yes, there is a difference. A dictionary is just an object type. In this case, the library
smtplib
implements the classSMTP
and you’re defining an instance of it, just like the JS classes.– Woss
I’m not finding any material that detail this. I appreciate the clarification.
– Guilherme Hirsch
Have you checked the official documentation package?
– Woss
In Python a "dictionary" is not the same thing as an "object" - they are very different things - perhaps the biggest difference from Python to javascript. I recommend making the official language tutorial, step by step, in https://docs.python.org/3/tutorial/index.html
– jsbueno