Skip to content

Remove syntax warning - #3505

Merged
dcherian merged 1 commit into
pydata:masterfrom
max-sixty:warnings
Nov 9, 2019
Merged

Remove syntax warning#3505
dcherian merged 1 commit into
pydata:masterfrom
max-sixty:warnings

Conversation

@max-sixty

Copy link
Copy Markdown
Collaborator

Currently raises a SyntaxWarning (though I don't think causing any issues)

/home/vsts/work/1/s/xarray/plot/plot.py:291: SyntaxWarning: "is" with a literal. Did you mean "=="?
if args is ():

@dcherian
dcherian merged commit 897b5d1 into pydata:masterNov 9, 2019
@max-sixty
max-sixty deleted the warnings branch November 9, 2019 22:04
@crusaderky

Copy link
Copy Markdown
Contributor

Yes, is () instead of == () accidentally works on CPython because in order to save RAM CPython has a bunch of hardcoded objects that are defined at interpreter level. That's however an implementation detail, and there's no guarantee it won't break on an alternative implementation, or even on a future version of CPython.

>>>a= () >>>b= () >>>aisbTrue>>>a= (1, 2) >>>b= (1, 2) >>>aisbFalse>>>x=1>>>y=1>>>xisyTrue>>>x=1000>>>y=1000>>>xisyFalse>>>forxinrange(1000): ... y=int(str((x))) ... ifxisnoty: ... print(x) ... break257

dcherian added a commit to dcherian/xarray that referenced this pull request Nov 12, 2019
* upstream/master:
add missing pint integration tests (pydata#3508)
DOC: update bottleneck repo url (pydata#3507)
add drop_sel, drop_vars, map to api.rst (pydata#3506)
remove syntax warning (pydata#3505)
Dataset.map, GroupBy.map, Resample.map (pydata#3459)
tests for datasets with units (pydata#3447)
fix pandas-dev tests (pydata#3491)
unpin pseudonetcdf (pydata#3496)
whatsnew corrections (pydata#3494)
dcherian added a commit to dcherian/xarray that referenced this pull request Nov 12, 2019
* upstream/master:
add missing pint integration tests (pydata#3508)
DOC: update bottleneck repo url (pydata#3507)
add drop_sel, drop_vars, map to api.rst (pydata#3506)
remove syntax warning (pydata#3505)
Dataset.map, GroupBy.map, Resample.map (pydata#3459)
tests for datasets with units (pydata#3447)
fix pandas-dev tests (pydata#3491)
unpin pseudonetcdf (pydata#3496)
whatsnew corrections (pydata#3494)
drop_vars; deprecate drop for variables (pydata#3475)
uamiv test using only raw uamiv variables (pydata#3485)
Optimize dask array equality checks. (pydata#3453)
dcherian added a commit to dcherian/xarray that referenced this pull request Nov 13, 2019
* upstream/master:
format indexing.rst code with black (pydata#3511)
add missing pint integration tests (pydata#3508)
DOC: update bottleneck repo url (pydata#3507)
add drop_sel, drop_vars, map to api.rst (pydata#3506)
remove syntax warning (pydata#3505)
Dataset.map, GroupBy.map, Resample.map (pydata#3459)
tests for datasets with units (pydata#3447)
fix pandas-dev tests (pydata#3491)
unpin pseudonetcdf (pydata#3496)
whatsnew corrections (pydata#3494)
drop_vars; deprecate drop for variables (pydata#3475)
uamiv test using only raw uamiv variables (pydata#3485)
Optimize dask array equality checks. (pydata#3453)
Propagate indexes in DataArray binary operations. (pydata#3481)
python 3.8 tests (pydata#3477)
dcherian added a commit to dcherian/xarray that referenced this pull request Nov 13, 2019
commit d430ae0
Author: dcherian <deepak@cherian.net>
Date: Wed Nov 13 08:27:04 2019 -0700
proper fix.
commit 7fd69be
Author: dcherian <deepak@cherian.net>
Date: Wed Nov 13 08:03:26 2019 -0700
fix whats-new merge.
commit 4489394
Merge: 279ff1db74f80c
Author: dcherian <deepak@cherian.net>
Date: Wed Nov 13 08:03:06 2019 -0700
Merge remote-tracking branch 'upstream/master' into fix/plot-broadcast
* upstream/master:
format indexing.rst code with black (pydata#3511)
add missing pint integration tests (pydata#3508)
DOC: update bottleneck repo url (pydata#3507)
add drop_sel, drop_vars, map to api.rst (pydata#3506)
remove syntax warning (pydata#3505)
Dataset.map, GroupBy.map, Resample.map (pydata#3459)
tests for datasets with units (pydata#3447)
fix pandas-dev tests (pydata#3491)
unpin pseudonetcdf (pydata#3496)
whatsnew corrections (pydata#3494)
drop_vars; deprecate drop for variables (pydata#3475)
uamiv test using only raw uamiv variables (pydata#3485)
Optimize dask array equality checks. (pydata#3453)
Propagate indexes in DataArray binary operations. (pydata#3481)
python 3.8 tests (pydata#3477)
commit 279ff1d
Author: dcherian <deepak@cherian.net>
Date: Wed Nov 13 08:02:44 2019 -0700
Undo the transpose change and add test to make sure transposition is right.
commit c9cc698
Author: dcherian <deepak@cherian.net>
Date: Wed Nov 13 08:01:39 2019 -0700
Test to make sure transpose is right
commit 9b35ecf
Author: dcherian <deepak@cherian.net>
Date: Sat Nov 2 15:49:08 2019 -0600
Additional test.
commit 7aed950
Author: dcherian <deepak@cherian.net>
Date: Sat Nov 2 15:20:07 2019 -0600
make plotting work with transposed nondim coords.
dcherian added a commit to dcherian/xarray that referenced this pull request Nov 17, 2019
* upstream/master: (22 commits)
Added fill_value for unstack (pydata#3541)
Add DatasetGroupBy.quantile (pydata#3527)
ensure rename does not change index type (pydata#3532)
Leave empty slot when not using accessors
interpolate_na: Add max_gap support. (pydata#3302)
units & deprecation merge (pydata#3530)
Fix set_index when an existing dimension becomes a level (pydata#3520)
add Variable._replace (pydata#3528)
Tests for module-level functions with units (pydata#3493)
Harmonize `FillValue` and `missing_value` during encoding and decoding steps (pydata#3502)
FUNDING.yml (pydata#3523)
Allow appending datetime & boolean variables to zarr stores (pydata#3504)
warn if dim is passed to rolling operations. (pydata#3513)
Deprecate allow_lazy (pydata#3435)
Recursive tokenization (pydata#3515)
format indexing.rst code with black (pydata#3511)
add missing pint integration tests (pydata#3508)
DOC: update bottleneck repo url (pydata#3507)
add drop_sel, drop_vars, map to api.rst (pydata#3506)
remove syntax warning (pydata#3505)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@max-sixty@crusaderky@dcherian