Doc: fix python override examples

+19 -5
+19 -5
doc/languages-frameworks/python.md
··· 715 715 In the following example we change the name of the package `pandas` to `foo`. 716 716 ``` 717 717 newpkgs = pkgs.overridePackages(self: super: rec { 718 - python35Packages = super.python35Packages.override { 719 - self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};}; 718 + python35Packages = (super.python35Packages.override { self = python35Packages;}) 719 + // { pandas = super.python35Packages.pandas.override {name = "foo";}; 720 720 }; 721 721 }); 722 722 ``` ··· 727 727 (let 728 728 729 729 newpkgs = pkgs.overridePackages(self: super: rec { 730 - python35Packages = super.python35Packages.override { 731 - self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};}; 730 + python35Packages = (super.python35Packages.override { self = python35Packages;}) 731 + // { pandas = super.python35Packages.pandas.override {name = "foo";}; 732 732 }; 733 733 }); 734 734 in newpkgs.python35.withPackages (ps: [ps.blaze]) ··· 743 743 744 744 newpkgs = pkgs.overridePackages(self: super: rec { 745 745 python35Packages = super.python35Packages.override { 746 - self = python35Packages // { scipy = python35Packages.scipy_0_16;}; 746 + self = python35Packages // { scipy = python35Packages.scipy_0_17;}; 747 747 }; 748 748 }); 749 749 in newpkgs.python35.withPackages (ps: [ps.blaze]) 750 750 ).env 751 751 ``` 752 752 The requested package `blaze` depends upon `pandas` which itself depends on `scipy`. 753 + 754 + A similar example but now using `django` 755 + ``` 756 + with import <nixpkgs> {}; 757 + 758 + (let 759 + 760 + newpkgs = pkgs.overridePackages(self: super: rec { 761 + python27Packages = (super.python27Packages.override {self = python27Packages;}) 762 + // { django = super.python27Packages.django_1_9; }; 763 + }); 764 + in newpkgs.python27.withPackages (ps: [ps.django_guardian ]) 765 + ).env 766 + ``` 753 767 754 768 ### `python setup.py bdist_wheel` cannot create .whl 755 769