#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Smile Wonder function call and stack size


    I am a definite newbie to Python and I have some questions.

    C/C++ accumulated on the stack as a function of the number of arguments the function calling.

    To wonder if something does not seem to build on the stack as an argument to a function in the case of Python, Python's function call stack frame how to configure the stack size varies depending on the number of function arguments.

    Thank you for reply
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,889
    Rep Power
    481
    While there is a "stackless" version of python, I'm sure it can run out of memory too.

    Try this function:

    def f():f()

    f()


    import sys
    'setrecursionlimit' in dir(sys)
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    World
    Posts
    1
    Rep Power
    0
    I just read and I have a question. did you know how to create python script with flash include?? cos I dont know -_-
    thanks~
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    re


    if you don't know how to create python script with flash include, try find your answer.

    just like me.

    Originally Posted by dihae15
    I just read and I have a question. did you know how to create python script with flash include?? cos I dont know -_-
    thanks~
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    re


    I know about stackless version, But My question's source is this.

    python's decorator function.

    at c/c++ , detouring or hooking about variable argument function is imposible, but python decorator do this.

    so it's just my curiosity.

    Originally Posted by b49P23TIvg
    While there is a "stackless" version of python, I'm sure it can run out of memory too.

    Try this function:

    def f():f()

    f()


    import sys
    'setrecursionlimit' in dir(sys)
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,889
    Rep Power
    481
    If you know about decorators then you certainly know that
    Originally Posted by python glossary
    decorator
    A function returning another function, usually applied as a function transformation using the @wrapper syntax. Common examples for decorators are classmethod() and staticmethod().

    The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent:
    Code:
    def f(...):
        ...
    f = staticmethod(f)
    
    @staticmethod
    def f(...):
        ...
    The same concept exists for classes, but is less commonly used there. See the documentation for function definitions and class definitions for more about decorators.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo