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

Default dictionary in MixedIntegerLinearProgram #7637

Closed
nathanncohen mannequin opened this issue Dec 9, 2009 · 6 comments
Closed

Default dictionary in MixedIntegerLinearProgram #7637

nathanncohen mannequin opened this issue Dec 9, 2009 · 6 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 9, 2009

Martin Albrecht requested this functionality for his code, and it would also simplify mine. For short linear programs, of when some global variables do not require the creation of a new dictionary of variables ( from which only one field would be used ), this trick is good enough !

Nathann

CC: @malb

Component: numerical

Author: Nathann Cohen

Reviewer: Martin Albrecht

Merged: sage-4.3.rc1

Issue created by migration from https://trac.sagemath.org/ticket/7637

@nathanncohen nathanncohen mannequin added this to the sage-4.3.1 milestone Dec 9, 2009
@nathanncohen nathanncohen mannequin added c: numerical labels Dec 9, 2009
@malb
Copy link
Member

malb commented Dec 9, 2009

comment:1
  • try: foo except AttributeError: seems to be favoured in the Python community over hasattr. It is also faster if the attribute does in fact exist.
    • Why do you call __getitem__() instead of using the normal syntax [x]?

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Dec 9, 2009

comment:2

Done !

@nathanncohen nathanncohen mannequin added the s: needs review label Dec 9, 2009
@malb
Copy link
Member

malb commented Dec 9, 2009

comment:3

Attachment: trac_7637.patch.gz

@mwhansen
Copy link
Contributor

Author: Nathann Cohen

@mwhansen
Copy link
Contributor

Reviewer: Martin Albrecht

@mwhansen
Copy link
Contributor

Merged: sage-4.3.rc1

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

No branches or pull requests

2 participants