Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:56:59+00:00 2026-06-13T00:56:59+00:00

While reading this: What is a metaclass in Python? , I am learning to

  • 0

While reading this: What is a metaclass in Python?, I am learning to use __new__ using the following snippet:-

class a(object):
    pass

a.__new__(int,'abcdef',(int,),{})

There could be some problem in calling __new__ using a.. But, I get the following error, the meaning of which I do not understand:-

TypeError: object.__new__(int) is not safe, use int.__new__()

If there is something to do with the usage of __new__, I can ammend that by reading some books. But, can someone please explain why this message comes:

object.__new__(int) is not safe, use int.__new__()

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:57:00+00:00Added an answer on June 13, 2026 at 12:57 am

    Put simply, prior to 2.6 – object.__new__ ignored arguments… Now it actually may do something with them… So the warning is that something different may happen.

    This post Any ideas about the best work around for __new__ losing its arguments? – has a much more detailed explanation.

    You probably also want to be looking at http://docs.python.org/library/functions.html#type

    Knowing what’s possible with all the meta stuff in Python is great, but just as a warning, I wouldn’t get too hung up about it – as I’ve seen some really “clever” solutions, that are just monstrosities…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While reading this class BitmapFactory I noticed that almost all methods inside are static.
While reading the web2py manual, I came across this following: 'Once a new user
While reading a book, i came across this statement: The methods of an object
while reading about declare construct from php manual i tried the following example using
While I was reading this tutorial on monads, found the following expression. data M
I was reading this post While or Tail Recursion in F#, what to use
While reading a binary file using DJGPP on DOS this code hangs. This happens
I came across this class while reading a C# book and have some questions.
While reading this , I'm confused by the following examples: // Example 2: Explicit
While reading a post on StackOverflow (http://stackoverflow.com/questions/1502081/im-trying-to-optimize-this-c-code-using-4-way-loop-unrolling), which is now marked as closed, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.