Click here to Skip to main content
15,440,621 members

Comments by Rahul VB (Top 200 by date)

Rahul VB 7-Feb-21 4:06am View     CRLF
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     CRLF
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     CRLF
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     CRLF
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
Rahul VB 10-Jun-19 5:18am View    
Thanks for trying. But i am sure that i saw the prints twice and i copy pasted the output from the interpreter (idle). Let me try the way you did and cross check. Thanks for trying out :)