+ 20
Does anyone know what in 🐍 means ⚫⚫⚫ 'triple dots', class 'ellipsis' ❓❓❓
I did some "research" but have no idea & I need more information ‼️ https://code.sololearn.com/ckASJ4jAkNgB/?ref=app
5 ответов
+ 11
https://docs.python.org/3/library/constants.html?highlight=ellipsis#Ellipsis
Ellipsis
The same as the ellipsis literal “...”. Special value used mostly in conjunction with extended slicing syntax for user-defined container data types.
https://docs.python.org/3/library/stdtypes.html?highlight=ellipsis
The Ellipsis Object
This object is commonly used by slicing (see Slicings). It supports no special operations. There is exactly one ellipsis object, named Ellipsis (a built-in name). type(Ellipsis)() produces the Ellipsis singleton.
It is written as Ellipsis or ....
https://docs.python.org/3/whatsnew/3.0.html?highlight=ellipsis
The ellipsis (...) can be used as an atomic expression anywhere. (Previously it was only allowed in slices.) Also, it must now be spelled as .... (Previously it could also be spelled as . . ., by a mere accident of the grammar.)
https://realpython.com/python-ellipsis/?utm_source=notification_summary&utm_medium=email&utm_campaign=2022-09-20
+ 11
+ 9
Great, thx ☺️🤔
+ 9
hi Janusz, beside the ellipsis you can use each other object name like str, int and so on
# magic 3...
see my comments in each line.
print(str)#class str
print(id(str))# class id
print(type(str))#object type
print(dir(str))#list of class methods
help(str)#complete help for class
+ 1
very very