Click here to Skip to main content
15,609,550 members

Comments by Rahul VB (Top 200 by date)

Rahul VB 4 days ago View    
Question is not clear, what is it that you want? what is it that you have tried?
Rahul VB 7-Feb-21 4:06am View    
Hello OG,

Thanks for the answer, i was just playing arround with some stuff, so thought of asking.

Thanks,
Rahul
Rahul VB 4-Oct-19 17:27pm View    
Hello Sir,

Thanks for the solution. So does this mean that using fputc will not increment stdout?

Thanks,
Rahul
Rahul VB 4-Oct-19 17:26pm View    
Hello Sir,

I would request you to let me know which code or possible fix can be used to justify that the bug can be ignored.Because we also need to write a unit test to prove that what ever is our analysis is correct.

After referencing to multiple sites , i see that using any function like putc and writing to stdout should solve the problem.

Is my understanding correct? Because somehow if i can prove that stdout buffer is incremented using putchar, then i can provide a fix.

Thanks,
Rahul
Rahul VB 11-Jun-19 4:53am View    
The @ statement is called decoration:
For ex:
def decorator(func):
def wrapper():
additional code...
func()
return wrapper

def originalFunc():
print('i am the original func')

modifiedFunc = decorator(originalFunc)
modifiedFunc()
- So when i call modifiedFunc it gets called with additional code inside the wrapper along with the original functionality.

Instead of doing all the above i can simply do:

@decorator
def originalFunc():
print('i am the original func')

Now when i call originalFunc(), it work the way exactly i showed above.
This is a very important functionality in python. A simple function can behave as per requirement differently along with its original code depending upon requirements.
So, basically my question was on class decorators.

Thanks,
Rahul