-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?

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? Commented Feb 1, 2017 at 11:25

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.