Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36305

Re: Over 30 types of variables available in python ?

Date 2013-01-06 18:32 -0500
From Dave Angel <d@davea.name>
Subject Re: Over 30 types of variables available in python ?
References <1357513931.54941.YahooMailNeo@web125504.mail.ne1.yahoo.com>
Newsgroups comp.lang.python
Message-ID <mailman.198.1357515157.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 01/06/2013 06:12 PM, chaouche yacine wrote:
> booleans
> ints, floats, longs, complexes
> strings, unicode strings
> lists, tuples, dictionaries, dictionary views, sets, frozensets, buffers, bytearrays, slices
> functions, methods, code objects,modules,classes, instances, types, nulls (there is exactly one object of type Null which is None), tracebacks, frames
> generators, iterators, xranges,
> files,
>
> memoryviews,
> context managers,
>
> These are all listed in this page http://docs.python.org/2/library/stdtypes.html as built-in types. Am I getting anything wrong here ? I'm a bit confused about it. I have never seen so many types in the few programming languages I saw.
>

First, you're describing Python 2.x ;    3.x is different in a few
ways.  For one, int and long are combined into a single type.

Variables don't have types.  Only objects have types.  A name can be
bound to any object, regardless of its type, or to what it might have
been previously bound.

Otherwise, you're right.  Python is a rich language, with "batteries
included."  There's a lot in the built-in space, but if you include the
stdlib, it's really rich.  And if you include the fact that objects you
define yourself are first-class, there are very few limits.



-- 

DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Over 30 types of variables available in python ? Dave Angel <d@davea.name> - 2013-01-06 18:32 -0500

csiph-web