Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for How to get a function's name as string?

Current License: CC BY-SA 3.0

40 events
when toggle format what by license comment
S Jun 16, 2017 at 18:57 history bounty ended Community Bot
S Jun 16, 2017 at 18:57 history notice removed Community Bot
Jun 15, 2017 at 8:06 answer added Erdenezul timeline score: 1
Jun 11, 2017 at 17:53 answer added Sagar V timeline score: 4
Jun 8, 2017 at 23:39 history edited Asif Raza
edited tags
S Jun 8, 2017 at 17:34 history bounty started Asif Raza
S Jun 8, 2017 at 17:34 history notice added Asif Raza Draw attention
May 30, 2017 at 11:35 vote accept Asif Raza
May 28, 2017 at 21:49 review Close votes
May 29, 2017 at 3:34
May 28, 2017 at 16:35 answer added Asif Raza timeline score: 11
May 28, 2017 at 16:26 history reopened PM 2Ring
Abacus
Mahi
mustaccio
slfan
May 28, 2017 at 14:09 comment added Code-Apprentice What is the purpose of getting a function name as a string? What will you do with the name?
May 28, 2017 at 13:10 history edited PM 2Ring CC BY-SA 3.0
deleted 1 character in body
May 28, 2017 at 12:43 history edited PM 2Ring CC BY-SA 3.0
Improved grammar, restored the "greeting" example, hid proposed solution inside a HTML comment.
May 28, 2017 at 12:22 history edited Asif Raza CC BY-SA 3.0
correct error
May 28, 2017 at 12:10 review Reopen votes
May 28, 2017 at 16:26
May 28, 2017 at 12:00 history edited Asif Raza CC BY-SA 3.0
improved question
May 28, 2017 at 11:55 comment added Asif Raza Let us continue this discussion in chat.
May 28, 2017 at 11:54 history edited Asif Raza CC BY-SA 3.0
provide solution
May 28, 2017 at 11:50 comment added PM 2Ring @A.Raza Certainly!
May 28, 2017 at 11:48 comment added Asif Raza @PM2Ring can I use your description comment in my question solution section?
May 28, 2017 at 11:44 history closed Daniel
Eugene Morozov
Stefan Pochmann
Peter Gibson
PM 2Ring
Needs details or clarity
May 28, 2017 at 11:44 comment added PM 2Ring greeting.capitalize is a function object, and that object has a .__name__ attribute that you can access. But greeting.capitalize() calls the function object and returns the capitalized version of the greeting string, and that string object doesn't have a .__name__ attribute. (But even if it did have a .__name__, it'd be the name of the string, not the name of the function used to create the string). And you can't do str.capitalize() because when you call the "raw" str.capitalize function you need to pass it a string argument to capitalize.
May 28, 2017 at 11:39 comment added Asif Raza @PM2Ring capitalize().__name__ not have an attribute __name__ it is the problem.
May 28, 2017 at 11:37 comment added Asif Raza Not clearly get it.
May 28, 2017 at 11:36 history edited Asif Raza CC BY-SA 3.0
added 6 characters in body
May 28, 2017 at 11:35 review Close votes
May 28, 2017 at 11:45
May 28, 2017 at 11:35 comment added PM 2Ring Do you understand why adding the parentheses causes a problem?
May 28, 2017 at 11:34 history edited Asif Raza CC BY-SA 3.0
added 107 characters in body
May 28, 2017 at 11:32 comment added Asif Raza @PeterGibson Okay Thanks It's solved my problem.
May 28, 2017 at 11:30 comment added Peter Gibson Make sure you're not adding brackets after capitalize in that statement
May 28, 2017 at 11:30 history edited Asif Raza CC BY-SA 3.0
improve details
May 28, 2017 at 11:27 comment added Asif Raza @PM2Ring I got this TypeError: descriptor 'capitalize' of 'str' object needs an argument using str.capitalize.__name__
May 28, 2017 at 11:25 comment added Asif Raza @PeterGibson This is not what I need here
May 28, 2017 at 11:20 comment added Asif Raza @PeterGibson Let me check
May 28, 2017 at 11:17 comment added Peter Gibson If you want the name of the variable, you'd have to discover it separately stackoverflow.com/questions/2553354/…
May 28, 2017 at 11:16 comment added Asif Raza Returning error
May 28, 2017 at 11:15 comment added PM 2Ring What's wrong with str.capitalize.__name__ or greeting.capitalize.__name__?
May 28, 2017 at 11:13 history edited Asif Raza CC BY-SA 3.0
corrected spelling
May 28, 2017 at 11:06 history asked Asif Raza CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /