Skip to main content
add some examples
Source Link
Kai Burghardt
  • 1.2k
  • 7
  • 11

It depends. The question is whether the library is part of the language. If it is, merely specifying an import-clause is the most idiomatic solution and we should not penalize that. (Individual challenge authors may penalize it anyway but it’s their decision.)

If the imported library is a third-party plugin, however, i. e. not part of the programming language, you are outsourcing the implementation. Several loopholes forbidden by default try to prevent this.

It is therefore consistent that just importing a third-party symbol is not sufficient, but you will at least need to define your own symbol, too.


For instance, as far as I understand, the numpy library is a third-party library independently developed from the Python language. The existence of numpy is not guaranteed with any Python implementation. Hence

from numpy import * 

is an incomplete implementation of the n×n identity matrix function. You will need to declare a user-defined function.

On the other hand the C programming language defines (since C99) that (unless an implementation defines the __STDC_NO_COMPLEX__ symbol) the function carg is available via the complex.h header. Therefore

#include <complex.h> 

is a “complete” and in particular idiomatic implementation of the complex argument function.

It depends. The question is whether the library is part of the language. If it is, merely specifying an import-clause is the most idiomatic solution and we should not penalize that. (Individual challenge authors may penalize it anyway but it’s their decision.)

If the imported library is a third-party plugin, however, i. e. not part of the programming language, you are outsourcing the implementation. Several loopholes forbidden by default try to prevent this.

It is therefore consistent that just importing a third-party symbol is not sufficient, but you will at least need to define your own symbol, too.

It depends. The question is whether the library is part of the language. If it is, merely specifying an import-clause is the most idiomatic solution and we should not penalize that. (Individual challenge authors may penalize it anyway but it’s their decision.)

If the imported library is a third-party plugin, however, i. e. not part of the programming language, you are outsourcing the implementation. Several loopholes forbidden by default try to prevent this.

It is therefore consistent that just importing a third-party symbol is not sufficient, but you will at least need to define your own symbol, too.


For instance, as far as I understand, the numpy library is a third-party library independently developed from the Python language. The existence of numpy is not guaranteed with any Python implementation. Hence

from numpy import * 

is an incomplete implementation of the n×n identity matrix function. You will need to declare a user-defined function.

On the other hand the C programming language defines (since C99) that (unless an implementation defines the __STDC_NO_COMPLEX__ symbol) the function carg is available via the complex.h header. Therefore

#include <complex.h> 

is a “complete” and in particular idiomatic implementation of the complex argument function.

Source Link
Kai Burghardt
  • 1.2k
  • 7
  • 11

It depends. The question is whether the library is part of the language. If it is, merely specifying an import-clause is the most idiomatic solution and we should not penalize that. (Individual challenge authors may penalize it anyway but it’s their decision.)

If the imported library is a third-party plugin, however, i. e. not part of the programming language, you are outsourcing the implementation. Several loopholes forbidden by default try to prevent this.

It is therefore consistent that just importing a third-party symbol is not sufficient, but you will at least need to define your own symbol, too.