from new import classobj in Python 3.1 -


how can change given python 2.x statement compiled on 3.1.

the code line not works.

from new import classobj 

the error "there no module new".

in python 2.x new.classobj type of old-style types. there no old-style types in python 3.x. port code python 2.x python 3.x first need bring latest python 2.x standards, , in case means stop using old-style classes , use new-style classes.

so answer instead of classobj use type, you'll need upgrade 2.x code use type first , @ porting python 3.x

btw, see pep 3108 list of modules removed in python 3.x. in particular:

new

  • just rebinding of names 'types' module.
  • can call type built-in types easily.
  • docstring states module no longer useful of revision 27241
    (2002-06-15).

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -