-3
class int(x=0)
class int(x, base=10)

Return an integer object constructed from a number or string x, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

Question

On the above paragraph, what does "class" mean?

Community
  • 1
  • 1
  • The word 'class' is in the code, but not in the paragraph. What is exactly your goal? Trying to understand something better? because this kinda looks like a homework question? – Nanne Feb 01 '17 at 11:25

2 Answers2

0

I think they changed them all to class instead of type

# Python 2
>>> int
<type 'int'>
>>> str
<type 'str'>
>>> bool
<type 'bool'>

# Python 3
>>> int
<class 'int'>
>>> str
<class 'str'>
>>> bool
<class 'bool'>

You can also check this reply

Community
  • 1
  • 1
Seif
  • 1,058
  • 11
  • 19
0

It means the same thing as it does for all other classes, e.g:

class Foo: pass

it just means that it is a class.

Built-in classes are special merely because they are built-in to Python and as a result are more performant (they have some other minor quirks but that's another subject). All in all you can treat it the same as you would your custom class that's created with a class construct.

Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253