| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
If CO_NESTED is no longer useful, why not removing the flag rather than adding a complicated deprecated code path? Passing flags to compile() is uncommon.
@serhiy-storchaka: Do you think that a deprecation period is needed?
Since how long CO_NESTED does nothing?
Sorry, something went wrong.
2.2 |
Sorry, something went wrong.
|
Oh. If CO_NESTED is useless since Python 2.2 which was released 19 years ago, it's maybe time to remove it. |
Sorry, something went wrong.
|
Does this removal will cover disallowing from __future__ import nested_functions (and probably generators, which was from 2.1)? I can convert this patch to that way |
Sorry, something went wrong.
I don't see any benefit from removing this import: it doesn't reduce the Python maintenance burden, it just breaks existing applications for free. Most __future__ imports simply do nothing. Extract of Python/future.c: } else if (strcmp(feature, FUTURE_DIVISION) == 0) {
continue;
} else if (strcmp(feature, FUTURE_ABSOLUTE_IMPORT) == 0) {
continue;
} else if (strcmp(feature, FUTURE_WITH_STATEMENT) == 0) {
continue;
} else if (strcmp(feature, FUTURE_PRINT_FUNCTION) == 0) {
continue;
} else if (strcmp(feature, FUTURE_UNICODE_LITERALS) == 0) {
continue;
|
Sorry, something went wrong.
|
@isidentical Could you resolve the conflicts? |
Sorry, something went wrong.
|
FWIW, removal of CO_NESTED was discussed in #96811 and rejected, since it is still useful (to detect nested functions) and used in third-party code, and setting it doesn't cause any problems. |
Sorry, something went wrong.
In that case, I think we can close the PR. @isidentical What are your thoughts on this? |
Sorry, something went wrong.
| compile('print("\xe5")\n', '', 'exec') | ||
| self.assertRaises(ValueError, compile, chr(0), 'f', 'exec') | ||
| self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad') | ||
| self.assertRaises(ValueError, compile, 'obsolote_flag', 'f', 'exec', CO_NESTED) |
There was a problem hiding this comment.
| self.assertRaises(ValueError, compile, 'obsolote_flag', 'f', 'exec', CO_NESTED) | |
| self.assertRaises(ValueError, compile, 'obsolete_flag', 'f', 'exec', CO_NESTED) |
Sorry, something went wrong.
Let met close this old inactive PR. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR also removes a case related CO_GENERATOR_ALLOWED (which was also unusable, and totally purged in #19230)
https://bugs.python.org/issue40366