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


Groups > comp.lang.python > #33222

Getting module path string from a class instance

Date 2012-11-13 06:38 +0000
From Some Developer <someukdeveloper@gmail.com>
Subject Getting module path string from a class instance
Newsgroups comp.lang.python
Message-ID <mailman.3611.1352788721.27098.python-list@python.org> (permalink)

Show all headers | View raw


I'm trying to find a way to get a string of the module path of a class.

So for instance say I have class Foo and it is in a module called 
my.module. I want to be able to get a string that is equal to this: 
"my.module.Foo". I'm aware of the __repr__ method but it does not do 
what I want it to do in this case.

Can anyone offer any advice at all?

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


Thread

Getting module path string from a class instance Some Developer <someukdeveloper@gmail.com> - 2012-11-13 06:38 +0000
  Re: Getting module path string from a class instance Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-13 07:19 +0000
    Re: Getting module path string from a class instance Some Developer <someukdeveloper@gmail.com> - 2012-11-13 07:54 +0000
      Re: Getting module path string from a class instance Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-13 08:49 +0000
        Re: Getting module path string from a class instance Some Developer <someukdeveloper@gmail.com> - 2012-11-13 16:15 +0000

csiph-web