Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload class and methods inside, reload for-loop within function which has 'return', 'continue', 'break' statements #17

Open
James4Ever0 opened this issue Nov 9, 2022 · 3 comments

Comments

@James4Ever0
Copy link

James4Ever0 commented Nov 9, 2022

Example:

@reloading
class myClass:
    def myFunction(self, a):
        print(a)
    def forLoopInFunction(self):
        for i in reloading(range(3)):
            if i == 1: return 'value'
@James4Ever0
Copy link
Author

James4Ever0 commented Nov 10, 2022

#18 my attempt to solve problems for class and closure.

@James4Ever0 James4Ever0 changed the title Reload class and methods inside Reload class and methods inside, reload for-loop within function which has 'return' statement Nov 10, 2022
@James4Ever0 James4Ever0 changed the title Reload class and methods inside, reload for-loop within function which has 'return' statement Reload class and methods inside, reload for-loop within function which has 'return', 'continue', 'break' statements Nov 10, 2022
@James4Ever0
Copy link
Author

possible solution for solving problem for for-loop, transforming source code in-place

@James4Ever0
Copy link
Author

James4Ever0 commented Nov 10, 2022

for-loop does not behave correctly in following circumstance:

def function():
    val = None
    for i in reloading(range(2)):
        val = 'value'
    return val

val = function()
# value is None

also. reloading does not support multiple for-loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant