<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Thanks for all your comments. It appears to me that there is a slight confusion between types and classes then, plus other entities (protocols ?)<br><br>So my question is : is there a notion of "type" in python, like in other languages  (integers, booleans, floats, strings, characters (in c)) ? if so, can you give a list of the available "types" ? <br><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>The documentation (http://docs.python.org/2/library/stdtypes.html) states "</span>The principal built-in types are numerics, sequences, mappings, files, classes,
instances and exceptions."</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div><br></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Terry Reedy <tjreedy@udel.edu><br> <b><span style="font-weight: bold;">To:</span></b> python-list@python.org <br> <b><span
 style="font-weight: bold;">Sent:</span></b> Monday, January 7, 2013 1:45 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Over 30 types of variables available in python ?<br> </font> </div> <br>
On 1/6/2013 6:12 PM, chaouche yacine wrote:<br>> <br>> booleans<br>> ints, floats, longs, complexes<br>> strings, unicode strings<br>> lists, tuples, dictionaries, dictionary views, sets, frozensets,<br>> buffers, bytearrays, slices<br>> functions, methods, code objects,modules,classes, instances, types,<br>> nulls (there is exactly one object of type Null which is None),<br>> tracebacks, frames<br>> generators, iterators, xranges,<br>> files,<br>> memoryviews,<br>> context managers,<br>> <br>> These are all listed in this page<br>> http://docs.python.org/2/library/stdtypes.html as built-in types.<br><br>They would better be called classes. Every thing is Python is an instance of a class. 'Iterator' and 'context manager' are protocols that multiple classes can follow, not classes themselves.<br><br>> Am I<br>> getting anything wrong here ? I'm a bit confused about it. I have never<br>> seen so many
 types in the few programming languages I saw.<br><br>C has up to 8 integer types, Python 3 just 1. Most of the above are structures in C, which may or may not by typedef-ed, or classes in C++. If you counted all the structures and classes that come with C or C++, you would find a comparable number.<br><br>C stdlib has a pointer to file structure type, which is equivalent to Python's file class. It is true that C does not come with hashed arrays (sets) and hashed associative arrays (dicts), but they are often needed. So C programmers either reinvent the wheel or include a third-party library. C also has frame structure, but they are normally hidden. C programmers do not have easy direct access. However, virus writers learn to work with them ;-(.<br><br>-- Terry Jan Reedy<br><br>-- http://mail.python.org/mailman/listinfo/python-list<br><br><br> </div> </div>  </div></body></html>