Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
This revision was automatically updated to reflect the committed changes. Closed by commit rL255584: Make few adjustments after r255542. (authored by sivachandra). Changed prior to commit: http://reviews.llvm.org/D15511?vs=42796=42802#toc Repository: rL LLVM http://reviews.llvm.org/D15511 Files: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py === --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py @@ -619,10 +619,10 @@ def check_list_or_lambda(list_or_lambda, value): if six.callable(list_or_lambda): return list_or_lambda(value) -elif isinstance(list_or_lambda, list): -return list_or_lambda is None or value is None or value in list_or_lambda +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str): +return value is None or value in list_or_lambda else: -return list_or_lambda == value +return list_or_lambda is None or value is None or list_or_lambda == value # provide a function to xfail on defined oslist, compiler version, and archs # if none is specified for any argument, that argument won't be checked and thus means for all Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py === --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py @@ -619,10 +619,10 @@ def check_list_or_lambda(list_or_lambda, value): if six.callable(list_or_lambda): return list_or_lambda(value) -elif isinstance(list_or_lambda, list): -return list_or_lambda is None or value is None or value in list_or_lambda +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str): +return value is None or value in list_or_lambda else: -return list_or_lambda == value +return list_or_lambda is None or value is None or list_or_lambda == value # provide a function to xfail on defined oslist, compiler version, and archs # if none is specified for any argument, that argument won't be checked and thus means for all ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
sivachandra added a comment. I went ahead and committed this. Repository: rL LLVM http://reviews.llvm.org/D15511 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
tfiala added a comment. Yep this fixed the issues I was having on OS X with the related change. Thanks, Siva! Repository: rL LLVM http://reviews.llvm.org/D15511 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
zturner added inline comments. Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622 @@ -621,3 +621,3 @@ return list_or_lambda(value) -elif isinstance(list_or_lambda, list): -return list_or_lambda is None or value is None or value in list_or_lambda +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, str): +return value is None or value in list_or_lambda I mentioned this in the other thread, but I'm not sure we want the string check. if `list_or_lambda` is a string, then I think it should just check `list_or_lambda == value`. Otherwise the test only passes when `value` is a character, which is not now we use any of the decorators. Repository: rL LLVM http://reviews.llvm.org/D15511 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
I tried to google the semantics of the in keyword, but Python documentation is so horrible. I literally couldn't find a description of how it works :-/ Anyway, thanks! On Mon, Dec 14, 2015 at 7:27 PM Todd Fialawrote: > This seems right: > > python > Python 2.7.10 (default, Oct 23 2015, 18:05:06) > [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> s = 'abc' > >>> 'bc' in 'abc' > True > >>> 'bc' in s > True > >>> 'clang' in 'clang' > True > > On Mon, Dec 14, 2015 at 6:45 PM, Siva Chandra > wrote: > >> On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner >> wrote: >> > zturner added inline comments. >> > >> > >> > Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622 >> > @@ -621,3 +621,3 @@ >> > return list_or_lambda(value) >> > -elif isinstance(list_or_lambda, list): >> > -return list_or_lambda is None or value is None or value in >> list_or_lambda >> > +elif isinstance(list_or_lambda, list) or >> isinstance(list_or_lambda, str): >> > +return value is None or value in list_or_lambda >> > >> > I mentioned this in the other thread, but I'm not sure we want the >> string check. if `list_or_lambda` is a string, then I think it should just >> check `list_or_lambda == value`. Otherwise the test only passes when >> `value` is a character, which is not now we use any of the decorators. >> >> AFAIK, there is no character type in Python. The code 'value in >> list_or_lambda' returns True if |value| is a substring of >> |list_or_lambda|. For example, 'db' in 'lldb' evaluates to True. >> > > > > -- > -Todd > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15511: Make few adjustments after r255542.
This seems right: python Python 2.7.10 (default, Oct 23 2015, 18:05:06) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> s = 'abc' >>> 'bc' in 'abc' True >>> 'bc' in s True >>> 'clang' in 'clang' True On Mon, Dec 14, 2015 at 6:45 PM, Siva Chandrawrote: > On Mon, Dec 14, 2015 at 6:42 PM, Zachary Turner > wrote: > > zturner added inline comments. > > > > > > Comment at: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py:622 > > @@ -621,3 +621,3 @@ > > return list_or_lambda(value) > > -elif isinstance(list_or_lambda, list): > > -return list_or_lambda is None or value is None or value in > list_or_lambda > > +elif isinstance(list_or_lambda, list) or isinstance(list_or_lambda, > str): > > +return value is None or value in list_or_lambda > > > > I mentioned this in the other thread, but I'm not sure we want the > string check. if `list_or_lambda` is a string, then I think it should just > check `list_or_lambda == value`. Otherwise the test only passes when > `value` is a character, which is not now we use any of the decorators. > > AFAIK, there is no character type in Python. The code 'value in > list_or_lambda' returns True if |value| is a substring of > |list_or_lambda|. For example, 'db' in 'lldb' evaluates to True. > -- -Todd ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits